home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / console-setup.config < prev    next >
Text File  |  2008-08-27  |  76KB  |  2,995 lines

  1. #!/bin/bash
  2.  
  3. #     Copyright ┬⌐ 2005 Anton Zinoviev <anton@lml.bas.bg>
  4.  
  5. #     This program is free software; you can redistribute it and/or modify
  6. #     it under the terms of the GNU General Public License as published by
  7. #     the Free Software Foundation; either version 2 of the License, or
  8. #     (at your option) any later version.
  9.  
  10. #     This program is distributed in the hope that it will be useful,
  11. #     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. #     GNU General Public License for more details.
  14.  
  15. #     If you have not received a copy of the GNU General Public License
  16. #     along with this program, write to the Free Software Foundation, Inc.,
  17. #     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  
  19. #                        ----------
  20. #                         CONTENTS
  21. #                        ----------
  22. #
  23. # 1. Initialise $fontsets, $charmaps and $kbdnames with the supported
  24. #    fontsets, charmaps, keyboard models, layouts and variants.  These
  25. #    lists can not be computed because the config script is invoked
  26. #    during the preconfiguration phase and the available fonts, ACM,
  27. #    etc. are not yet unpacked.
  28. #
  29. # 2. Function ask_debconf.  Ask user to choose amongst the options
  30. #    listed in $fontsets, $charmaps and $kbdnames.
  31. #
  32. # 3. Function guess_arch - detect the architecture and subarchitecture
  33. #
  34. # 4. Function available_fontsets - lists all fontfaces that can be
  35. #    used with $codeset.
  36. #
  37. # 5. Function available_fontsizes - lists all font sizes that can be
  38. #    used with the $codeset-$fontface combination.
  39. #
  40. # 6. Set $locale.  Set $default_codeset and $codeset_priority acording
  41. #    to $locale.
  42. #
  43. # 7. Set $default_layout and acording to $locale. default_variant=''
  44. #
  45. # 8. Set $default_charmap and $charmap_priority acording to $locale.
  46. #
  47. # 9. Set $arch.  Set $default_model and $model_priority acording to
  48. #    $arch.
  49. #
  50. # 10. Read /etc/default/console-setup and store values into debconf
  51. #     db.  Four very long case instructions in order to translate
  52. #     options like "grp:caps_toggle" to human-readable strings like
  53. #     "Caps Lock".
  54. #
  55. # 11. Ask the Debconf questions starting from STATE=1 and ending after
  56. #     STATE=9.  Again four long case instructions in STATE=4 to
  57. #     translate "Caps Lock" to "grp:caps_toggle".
  58.  
  59. # This script would be simpler and faster if written in Perl but with
  60. # Shell it can be used in the Installer
  61.  
  62. set -e
  63.  
  64. . /usr/share/debconf/confmodule
  65.  
  66. CONFIGFILE=/etc/default/console-setup
  67.  
  68. package=console-setup
  69. # package=console-setup
  70.  
  71. fontsets='Arabic-Fixed15
  72. Arabic-Fixed16
  73. Arabic-VGA14
  74. Arabic-VGA16
  75. Arabic-VGA8
  76. Armenian-Fixed13
  77. Armenian-Fixed14
  78. Armenian-Fixed15
  79. Armenian-Fixed16
  80. Armenian-Fixed18
  81. CyrAsia-Fixed13
  82. CyrAsia-Fixed14
  83. CyrAsia-Fixed15
  84. CyrAsia-Fixed16
  85. CyrAsia-Fixed18
  86. CyrAsia-Terminus12x6
  87. CyrAsia-Terminus14
  88. CyrAsia-Terminus16
  89. CyrAsia-Terminus20x10
  90. CyrAsia-Terminus24x12
  91. CyrAsia-Terminus28x14
  92. CyrAsia-Terminus32x16
  93. CyrAsia-TerminusBold14
  94. CyrAsia-TerminusBold16
  95. CyrAsia-TerminusBold20x10
  96. CyrAsia-TerminusBold24x12
  97. CyrAsia-TerminusBold28x14
  98. CyrAsia-TerminusBold32x16
  99. CyrAsia-TerminusBoldVGA14
  100. CyrAsia-TerminusBoldVGA16
  101. CyrKoi-Fixed13
  102. CyrKoi-Fixed14
  103. CyrKoi-Fixed15
  104. CyrKoi-Fixed16
  105. CyrKoi-Fixed18
  106. CyrKoi-Terminus12x6
  107. CyrKoi-Terminus14
  108. CyrKoi-Terminus16
  109. CyrKoi-Terminus20x10
  110. CyrKoi-Terminus24x12
  111. CyrKoi-Terminus28x14
  112. CyrKoi-Terminus32x16
  113. CyrKoi-TerminusBold14
  114. CyrKoi-TerminusBold16
  115. CyrKoi-TerminusBold20x10
  116. CyrKoi-TerminusBold24x12
  117. CyrKoi-TerminusBold28x14
  118. CyrKoi-TerminusBold32x16
  119. CyrKoi-TerminusBoldVGA14
  120. CyrKoi-TerminusBoldVGA16
  121. CyrKoi-VGA14
  122. CyrKoi-VGA16
  123. CyrKoi-VGA8
  124. CyrSlav-Fixed13
  125. CyrSlav-Fixed14
  126. CyrSlav-Fixed15
  127. CyrSlav-Fixed16
  128. CyrSlav-Fixed18
  129. CyrSlav-Terminus12x6
  130. CyrSlav-Terminus14
  131. CyrSlav-Terminus16
  132. CyrSlav-Terminus20x10
  133. CyrSlav-Terminus24x12
  134. CyrSlav-Terminus28x14
  135. CyrSlav-Terminus32x16
  136. CyrSlav-TerminusBold14
  137. CyrSlav-TerminusBold16
  138. CyrSlav-TerminusBold20x10
  139. CyrSlav-TerminusBold24x12
  140. CyrSlav-TerminusBold28x14
  141. CyrSlav-TerminusBold32x16
  142. CyrSlav-TerminusBoldVGA14
  143. CyrSlav-TerminusBoldVGA16
  144. CyrSlav-VGA14
  145. CyrSlav-VGA16
  146. CyrSlav-VGA8
  147. Ethiopian-Fixed15
  148. Ethiopian-Fixed18
  149. Ethiopian-Goha12
  150. Ethiopian-Goha14
  151. Ethiopian-Goha16
  152. Ethiopian-GohaClassic12
  153. Ethiopian-GohaClassic14
  154. Ethiopian-GohaClassic16
  155. Georgian-Fixed13
  156. Georgian-Fixed14
  157. Georgian-Fixed15
  158. Georgian-Fixed16
  159. Georgian-Fixed18
  160. Greek-Fixed13
  161. Greek-Fixed14
  162. Greek-Fixed15
  163. Greek-Fixed16
  164. Greek-Fixed18
  165. Greek-Terminus12x6
  166. Greek-Terminus14
  167. Greek-Terminus16
  168. Greek-Terminus20x10
  169. Greek-Terminus24x12
  170. Greek-Terminus28x14
  171. Greek-Terminus32x16
  172. Greek-TerminusBold14
  173. Greek-TerminusBold16
  174. Greek-TerminusBold20x10
  175. Greek-TerminusBold24x12
  176. Greek-TerminusBold28x14
  177. Greek-TerminusBold32x16
  178. Greek-TerminusBoldVGA14
  179. Greek-TerminusBoldVGA16
  180. Greek-VGA14
  181. Greek-VGA16
  182. Greek-VGA8
  183. Hebrew-Fixed13
  184. Hebrew-Fixed14
  185. Hebrew-Fixed15
  186. Hebrew-Fixed16
  187. Hebrew-Fixed18
  188. Hebrew-VGA14
  189. Hebrew-VGA16
  190. Hebrew-VGA8
  191. Lao-Fixed14
  192. Lao-Fixed15
  193. Lao-Fixed16
  194. Lat15-Fixed13
  195. Lat15-Fixed14
  196. Lat15-Fixed15
  197. Lat15-Fixed16
  198. Lat15-Fixed18
  199. Lat15-Terminus12x6
  200. Lat15-Terminus14
  201. Lat15-Terminus16
  202. Lat15-Terminus20x10
  203. Lat15-Terminus24x12
  204. Lat15-Terminus28x14
  205. Lat15-Terminus32x16
  206. Lat15-TerminusBold14
  207. Lat15-TerminusBold16
  208. Lat15-TerminusBold20x10
  209. Lat15-TerminusBold24x12
  210. Lat15-TerminusBold28x14
  211. Lat15-TerminusBold32x16
  212. Lat15-TerminusBoldVGA14
  213. Lat15-TerminusBoldVGA16
  214. Lat15-VGA14
  215. Lat15-VGA16
  216. Lat15-VGA8
  217. Lat2-Fixed13
  218. Lat2-Fixed14
  219. Lat2-Fixed15
  220. Lat2-Fixed16
  221. Lat2-Fixed18
  222. Lat2-Terminus12x6
  223. Lat2-Terminus14
  224. Lat2-Terminus16
  225. Lat2-Terminus20x10
  226. Lat2-Terminus24x12
  227. Lat2-Terminus28x14
  228. Lat2-Terminus32x16
  229. Lat2-TerminusBold14
  230. Lat2-TerminusBold16
  231. Lat2-TerminusBold20x10
  232. Lat2-TerminusBold24x12
  233. Lat2-TerminusBold28x14
  234. Lat2-TerminusBold32x16
  235. Lat2-TerminusBoldVGA14
  236. Lat2-TerminusBoldVGA16
  237. Lat2-VGA14
  238. Lat2-VGA16
  239. Lat2-VGA8
  240. Lat38-Fixed13
  241. Lat38-Fixed14
  242. Lat38-Fixed15
  243. Lat38-Fixed16
  244. Lat38-Fixed18
  245. Lat38-VGA14
  246. Lat38-VGA16
  247. Lat38-VGA8
  248. Lat7-Fixed13
  249. Lat7-Fixed14
  250. Lat7-Fixed15
  251. Lat7-Fixed16
  252. Lat7-Fixed18
  253. Lat7-Terminus12x6
  254. Lat7-Terminus14
  255. Lat7-Terminus16
  256. Lat7-Terminus20x10
  257. Lat7-Terminus24x12
  258. Lat7-Terminus28x14
  259. Lat7-Terminus32x16
  260. Lat7-TerminusBold14
  261. Lat7-TerminusBold16
  262. Lat7-TerminusBold20x10
  263. Lat7-TerminusBold24x12
  264. Lat7-TerminusBold28x14
  265. Lat7-TerminusBold32x16
  266. Lat7-TerminusBoldVGA14
  267. Lat7-TerminusBoldVGA16
  268. Lat7-VGA14
  269. Lat7-VGA16
  270. Lat7-VGA8
  271. Thai-Fixed13
  272. Thai-Fixed14
  273. Thai-Fixed15
  274. Thai-Fixed16
  275. Thai-Fixed18
  276. Uni1-Fixed15
  277. Uni1-Fixed16
  278. Uni1-VGA14
  279. Uni1-VGA16
  280. Uni1-VGA8
  281. Uni2-Fixed13
  282. Uni2-Fixed14
  283. Uni2-Fixed15
  284. Uni2-Fixed16
  285. Uni2-Fixed18
  286. Uni2-Terminus12x6
  287. Uni2-Terminus14
  288. Uni2-Terminus16
  289. Uni2-Terminus20x10
  290. Uni2-Terminus24x12
  291. Uni2-Terminus28x14
  292. Uni2-Terminus32x16
  293. Uni2-TerminusBold14
  294. Uni2-TerminusBold16
  295. Uni2-TerminusBold20x10
  296. Uni2-TerminusBold24x12
  297. Uni2-TerminusBold28x14
  298. Uni2-TerminusBold32x16
  299. Uni2-TerminusBoldVGA14
  300. Uni2-TerminusBoldVGA16
  301. Uni2-VGA14
  302. Uni2-VGA16
  303. Uni2-VGA8
  304. Uni3-Fixed13
  305. Uni3-Fixed14
  306. Uni3-Fixed15
  307. Uni3-Fixed16
  308. Uni3-Fixed18
  309. Uni3-Terminus12x6
  310. Uni3-Terminus14
  311. Uni3-Terminus16
  312. Uni3-Terminus20x10
  313. Uni3-Terminus24x12
  314. Uni3-Terminus28x14
  315. Uni3-Terminus32x16
  316. Uni3-TerminusBold14
  317. Uni3-TerminusBold16
  318. Uni3-TerminusBold20x10
  319. Uni3-TerminusBold24x12
  320. Uni3-TerminusBold28x14
  321. Uni3-TerminusBold32x16
  322. Uni3-TerminusBoldVGA14
  323. Uni3-TerminusBoldVGA16
  324. Vietnamese-Fixed13
  325. Vietnamese-Fixed14
  326. Vietnamese-Fixed15
  327. Vietnamese-Fixed16
  328. Vietnamese-Fixed18
  329. '
  330. # fontsets='Arabic-Fixed15
  331. # Arabic-Fixed16
  332. # Arabic-vga14
  333. # ... 
  334. # Vietnamese-Fixed18
  335. # '
  336.  
  337. charmaps='ARMSCII-8
  338. CP1251
  339. CP1255
  340. CP1256
  341. GEORGIAN-ACADEMY
  342. GEORGIAN-PS
  343. IBM1133
  344. ISIRI-3342
  345. ISO-8859-1
  346. ISO-8859-10
  347. ISO-8859-11
  348. ISO-8859-13
  349. ISO-8859-14
  350. ISO-8859-15
  351. ISO-8859-16
  352. ISO-8859-2
  353. ISO-8859-3
  354. ISO-8859-4
  355. ISO-8859-5
  356. ISO-8859-6
  357. ISO-8859-7
  358. ISO-8859-8
  359. ISO-8859-9
  360. KOI8-R
  361. KOI8-U
  362. TIS-620
  363. VISCII
  364. UTF-8'
  365.  
  366. # charmaps='ARMSCII-8
  367. # CP1251
  368. # CP1255
  369. # ...
  370. # UTF-8'
  371.  
  372. kbdnames='model*logidinovo*Logitech diNovo Keyboard
  373. model*amiga*Amiga
  374. model*acer_c300*Acer C300
  375. model*yahoo*Yahoo! Internet Keyboard
  376. model*macintosh*Macintosh
  377. model*dell101*Dell 101-key PC
  378. model*mx2500*Memorex MX2500 EZ-Access Keyboard
  379. model*geniuscomfy2*Genius Comfy KB-21e-Scroll
  380. model*pc98*PC-98xx Series
  381. model*hp2505*Hewlett-Packard SK-2505 Internet Keyboard
  382. model*dell*Dell
  383. model*logiinkseusb*Logitech iTouch Internet Navigator Keyboard SE (USB)
  384. model*ipaq*Compaq iPaq Keyboard
  385. model*sk1300*SK-1300
  386. model*vsonku306*ViewSonic KU-306 Internet Keyboard
  387. model*mx2750*Memorex MX2750
  388. model*logitech_g15*Logitech G15 extra keys via G15daemon
  389. model*hp5181*Hewlett-Packard Internet Keyboard 5181
  390. model*scorpius*Advance Scorpius KI
  391. model*compaqik18*Compaq Internet Keyboard (18 keys)
  392. model*brother*Brother Internet Keyboard
  393. model*acpi*ACPI Standard
  394. model*pc105*Generic 105-key (Intl) PC
  395. model*btc9019u*BTC 9019U
  396. model*gyration*Gyration
  397. model*rapidaccess2a*IBM Rapid Access II (alternate option)
  398. model*acer_ferrari4k*Acer Ferrari 4000
  399. model*qtronix*QTronix Scorpius 98N+
  400. model*dellusbmm*Dell USB Multimedia Keybard
  401. model*hp2501*Hewlett-Packard SK-2501 Multimedia Keyboard
  402. model*hpxt1000*Hewlett-Packard Omnibook XT1000
  403. model*macintosh_hhk*Happy Hacking Keyboard for Mac
  404. model*acer_laptop*Acer Laptop
  405. model*microsoftelite*Microsoft Natural Keyboard Elite
  406. model*hhk*Happy Hacking Keyboard
  407. model*diamond*Diamond 9801 / 9802 series
  408. model*hpxe3gc*Hewlett-Packard Omnibook XE3 GC
  409. model*samsung4510*Samsung SDM 4510P
  410. model*pc104*Generic 104-key PC
  411. model*emachines*Laptop/notebook eMachines m68xx
  412. model*oretec*Ortek MCK-800 MM/Internet keyboard
  413. model*btc6301urf*BTC 6301URF
  414. model*trustda*Trust Direct Access Keyboard
  415. model*btc5090*BTC 5090
  416. model*dellm65*Dell Precision M65
  417. model*dexxa*Dexxa Wireless Desktop Keyboard
  418. model*genius*Genius Comfy KB-16M / Genius MM Keyboard KWD-910
  419. model*logiex110*Logitech Cordless Desktop EX110
  420. model*geniuskb19e*Genius KB-19e NB
  421. model*btc5126t*BTC 5126T
  422. model*classmate*Classmate PC
  423. model*rapidaccess*IBM Rapid Access
  424. model*jp106*Japanese 106-key
  425. model*chicony9885*Chicony KB-9885
  426. model*logii350*Logitech Internet 350 Keyboard
  427. model*thinkpad*IBM ThinkPad 560Z/600/600E/A22E
  428. model*olpc*OLPC
  429. model*hpnx9020*Hewlett-Packard nx9020
  430. model*dellsk8125*Dell SK-8125
  431. model*trust*Trust Wireless Keyboard Classic
  432. model*asus_laptop*Asus Laptop
  433. model*mx1998*Memorex MX1998
  434. model*sk7100*SK-7100
  435. model*btc5113rf*BTC 5113RF Multimedia
  436. model*microsoftprousb*Microsoft Natural Keyboard Pro USB / Microsoft Internet Keyboard Pro
  437. model*btc9000*BTC 9000
  438. model*sp_inet*Super Power Multimedia Keyboard
  439. model*macbook79*MacBook/MacBook Pro (Intl)
  440. model*kr106*Korean 106-key
  441. model*hpi6*Hewlett-Packard Internet Keyboard
  442. model*macintosh_old*Macintosh Old
  443. model*hp6000*Hewlett-Packard Omnibook 6000/6100
  444. model*btc9001ah*BTC 9001AH
  445. model*logicink*Logitech Internet Navigator Keyboard
  446. model*omnikey101*Northgate OmniKey 101
  447. model*cherrycyboard*Cherry CyBo@rd USB-Hub
  448. model*armada*Laptop/notebook Compaq (eg. Armada) Laptop Keyboard
  449. model*macbook78*MacBook/MacBook Pro
  450. model*abnt2*Brazilian ABNT2
  451. model*microsoftmult*Microsoft Wireless Multimedia Keyboard 1.0A
  452. model*pc101*Generic 101-key PC
  453. model*logicd_opt*Logitech Cordless Desktop Optical
  454. model*logiultraxc*Logitech Ultra-X Cordless Media Desktop Keyboard
  455. model*microsoftprose*Microsoft Internet Keyboard Pro, Swedish
  456. model*itouch*Logitech iTouch
  457. model*hpzt11xx*Hewlett-Packard Pavilion ZT11xx
  458. model*geniuscomfy*Genius Comfy KB-12e
  459. model*logiultrax*Logitech Ultra-X Keyboard
  460. model*cherryblueb*Cherry CyMotion Master XPress
  461. model*hp5xx*Hewlett-Packard Omnibook 5xx
  462. model*apple*Apple
  463. model*microsoftinet*Microsoft Internet Keyboard
  464. model*samsung4500*Samsung SDM 4500P
  465. model*logiik*Logitech Internet Keyboard
  466. model*cherryblue*Cherry Blue Line CyBo@rd
  467. model*chicony*Chicony Internet Keyboard
  468. model*a4_rfkb23*A4Tech Wireless Desktop RFKB-23
  469. model*compaqik13*Compaq Internet Keyboard (13 keys)
  470. model*ataritt*Atari TT
  471. model*silvercrest*SILVERCREST Multimedia Wireless Keyboard
  472. model*propeller*Propeller Voyager (KTEZ-1000)
  473. model*dellsk8135*Dell SK-8135
  474. model*benqx*BenQ X-Touch
  475. model*hp500fa*Hewlett-Packard Omnibook 500 FA
  476. model*symplon*Symplon PaceBook (tablet PC)
  477. model*precision_m*Dell Laptop/notebook Precision M series
  478. model*microsoft*Microsoft Natural
  479. model*logicd*Logitech Cordless Desktop
  480. model*benqx730*BenQ X-Touch 730
  481. model*logiinkse*Logitech iTouch Internet Navigator Keyboard SE
  482. model*latitude*Dell Latitude series laptop
  483. model*ennyah_dkb1008*Ennyah DKB-1008
  484. model*pc102*Generic 102-key (Intl) PC
  485. model*logiitc*Logitech iTouch Cordless Keyboard (model Y-RB6)
  486. model*sk6200*SK-6200
  487. model*cymotionlinux*Cherry CyMotion Master Linux
  488. model*logidinovoedge*Logitech diNovo Edge Keyboard
  489. model*everex*Everex STEPnote
  490. model*a4techKB21*A4Tech KB-21
  491. model*compaqik7*Compaq Internet Keyboard (7 keys)
  492. model*apple_laptop*Apple Laptop
  493. model*thinkpadintl*IBM ThinkPad 560Z/600/600E/A22E, Intl
  494. model*winbook*Winbook Model XP5
  495. model*thinkpad60*IBM ThinkPad R60/T60/Z60m/Z60t/R61/T61/Z61m/Z61t
  496. model*logitech_base*Logitech Generic Keyboard
  497. model*inspiron*Dell Laptop/notebook Inspiron 6xxx/8xxx
  498. model*logiclx300*Logitech Cordless Desktop LX-300
  499. model*logicdn*Logitech Cordless Desktop Navigator
  500. model*rapidaccess2*IBM Rapid Access II
  501. model*sun4*Sun Type 4
  502. model*presario*Laptop/notebook Compaq (eg. Presario) Internet Keyboard
  503. model*logicdpa2*Logitech Cordless Desktop Pro (alternate option2)
  504. model*microsoftoffice*Microsoft Office Keyboard
  505. model*evdev*Evdev-managed keyboard
  506. model*honeywell_euroboard*Honeywell Euroboard
  507. model*dtk2000*DTK2000
  508. model*logicfn*Logitech Cordless Freedom/Desktop Navigator
  509. model*sun6*Sun Type 5/6
  510. model*logimel*Logitech Media Elite Keyboard
  511. model*hp5185*Hewlett-Packard Internet Keyboard 5185
  512. model*toshiba_s3000*Toshiba Satellite S3000
  513. model*airkey*Acer AirKey V
  514. model*sk2500*SK-2500
  515. model*azonaRF2300*Azona RF2300 wireless Internet Keyboard
  516. model*hpxe3gf*Hewlett-Packard Omnibook XE3 GF
  517. model*microsoftprooem*Microsoft Natural Keyboard Pro OEM
  518. model*benqx800*BenQ X-Touch 800
  519. model*sun5*Sun Type 5
  520. model*logiaccess*Logitech Access Keyboard
  521. model*btc9000a*BTC 9000A
  522. model*fscaa1667g*Fujitsu-Siemens Computers AMILO A1667G laptop
  523. model*microsoftpro*Microsoft Natural Keyboard Pro / Microsoft Internet Keyboard Pro
  524. model*SKIP*Do not configure keyboard; keep kernel keymap
  525. model*cherrybluea*Cherry Blue Line CyBo@rd (alternate option)
  526. model*logicd_it*Logitech Cordless Desktop iTouch
  527. model*chicony0108*Chicony KU-0108
  528. model*a4techKBS8*A4Tech KBS-8
  529. model*sven*SVEN Ergonomic 2500
  530. model*compaqeak8*Compaq Easy Access Keyboard
  531. model*flexpro*Keytronic FlexPro
  532. model*logicda*Logitech Cordless Desktop (alternate option)
  533. layout*sy*Syria
  534. variant*sy**Syria
  535. variant*sy*syc_phonetic*Syria - Syriac phonetic
  536. variant*sy*syc*Syria - Syriac
  537. variant*sy*ku*Syria - Kurdish, Latin Q
  538. variant*sy*ku_alt*Syria - Kurdish, Latin Alt-Q
  539. variant*sy*ku_f*Syria - Kurdish, (F)
  540. layout*se*Sweden
  541. variant*se**Sweden
  542. variant*se*svdvorak*Sweden - Svdvorak
  543. variant*se*dvorak*Sweden - Dvorak
  544. variant*se*nodeadkeys*Sweden - Eliminate dead keys
  545. variant*se*rus*Sweden - Russian phonetic
  546. variant*se*smi*Sweden - Northern Saami
  547. variant*se*rus_nodeadkeys*Sweden - Russian phonetic, eliminate dead keys
  548. variant*se*mac*Sweden - Macintosh
  549. layout*mn*Mongolia
  550. variant*mn**Mongolia
  551. layout*hu*Hungary
  552. variant*hu**Hungary
  553. variant*hu*101_qwerty_comma_dead*Hungary - 101/qwerty/comma/Dead keys
  554. variant*hu*102_qwerty_dot_dead*Hungary - 102/qwerty/dot/Dead keys
  555. variant*hu*101_qwertz_dot_dead*Hungary - 101/qwertz/dot/Dead keys
  556. variant*hu*101_qwertz_comma_dead*Hungary - 101/qwertz/comma/Dead keys
  557. variant*hu*101_qwertz_dot_nodead*Hungary - 101/qwertz/dot/Eliminate dead keys
  558. variant*hu*101_qwerty_comma_nodead*Hungary - 101/qwerty/comma/Eliminate dead keys
  559. variant*hu*101_qwerty_dot_dead*Hungary - 101/qwerty/dot/Dead keys
  560. variant*hu*101_qwertz_comma_nodead*Hungary - 101/qwertz/comma/Eliminate dead keys
  561. variant*hu*nodeadkeys*Hungary - Eliminate dead keys
  562. variant*hu*102_qwertz_dot_nodead*Hungary - 102/qwertz/dot/Eliminate dead keys
  563. variant*hu*102_qwerty_dot_nodead*Hungary - 102/qwerty/dot/Eliminate dead keys
  564. variant*hu*102_qwerty_comma_nodead*Hungary - 102/qwerty/comma/Eliminate dead keys
  565. variant*hu*102_qwerty_comma_dead*Hungary - 102/qwerty/comma/Dead keys
  566. variant*hu*standard*Hungary - Standard
  567. variant*hu*102_qwertz_comma_nodead*Hungary - 102/qwertz/comma/Eliminate dead keys
  568. variant*hu*101_qwerty_dot_nodead*Hungary - 101/qwerty/dot/Eliminate dead keys
  569. variant*hu*102_qwertz_dot_dead*Hungary - 102/qwertz/dot/Dead keys
  570. variant*hu*qwerty*Hungary - qwerty
  571. variant*hu*102_qwertz_comma_dead*Hungary - 102/qwertz/comma/Dead keys
  572. layout*np*Nepal
  573. variant*np**Nepal
  574. layout*pk*Pakistan
  575. variant*pk**Pakistan
  576. variant*pk*ara*Pakistan - Arabic
  577. layout*gn*Guinea
  578. variant*gn**Guinea
  579. layout*lk*Sri Lanka
  580. variant*lk**Sri Lanka
  581. variant*lk*tam_TAB*Sri Lanka - Tamil TAB Typewriter
  582. variant*lk*tam_unicode*Sri Lanka - Tamil Unicode
  583. layout*kr*Korea, Republic of
  584. variant*kr**Korea, Republic of
  585. variant*kr*kr104*Korea, Republic of - 101/104 key Compatible
  586. layout*cn*China
  587. variant*cn**China
  588. variant*cn*tib_asciinum*China - Tibetan (with ASCII numerals)
  589. variant*cn*tib*China - Tibetan
  590. layout*ee*Estonia
  591. variant*ee**Estonia
  592. variant*ee*dvorak*Estonia - Dvorak
  593. variant*ee*nodeadkeys*Estonia - Eliminate dead keys
  594. variant*ee*us*Estonia - US keyboard with Estonian letters
  595. layout*et*Ethiopia
  596. variant*et**Ethiopia
  597. layout*za*South Africa
  598. variant*za**South Africa
  599. layout*mao*Maori
  600. variant*mao**Maori
  601. layout*am*Armenia
  602. variant*am**Armenia
  603. variant*am*eastern-alt*Armenia - Alternative Eastern
  604. variant*am*western*Armenia - Western
  605. variant*am*phonetic-alt*Armenia - Alternative Phonetic
  606. variant*am*eastern*Armenia - Eastern
  607. variant*am*phonetic*Armenia - Phonetic
  608. layout*latam*Latin American
  609. variant*latam**Latin American
  610. variant*latam*sundeadkeys*Latin American - Sun dead keys
  611. variant*latam*nodeadkeys*Latin American - Eliminate dead keys
  612. layout*nec_vndr/jp*Japan (PC-98xx Series)
  613. variant*nec_vndr/jp**Japan (PC-98xx Series)
  614. layout*ie*Ireland
  615. variant*ie**Ireland
  616. variant*ie*ogam_is434*Ireland - Ogham IS434
  617. variant*ie*CloGaelach*Ireland - CloGaelach
  618. variant*ie*ogam*Ireland - Ogham
  619. variant*ie*UnicodeExpert*Ireland - UnicodeExpert
  620. layout*pt*Portugal
  621. variant*pt**Portugal
  622. variant*pt*sundeadkeys*Portugal - Sun dead keys
  623. variant*pt*nativo-epo*Portugal - Nativo for Esperanto
  624. variant*pt*mac_sundeadkeys*Portugal - Macintosh, Sun dead keys
  625. variant*pt*mac_nodeadkeys*Portugal - Macintosh, eliminate dead keys
  626. variant*pt*nodeadkeys*Portugal - Eliminate dead keys
  627. variant*pt*nativo-us*Portugal - Nativo for USA keyboards
  628. variant*pt*nativo*Portugal - Nativo
  629. variant*pt*mac*Portugal - Macintosh
  630. layout*ng*Nigeria
  631. variant*ng**Nigeria
  632. variant*ng*igbo*Nigeria - Igbo
  633. variant*ng*yoruba*Nigeria - Yoruba
  634. variant*ng*hausa*Nigeria - Hausa
  635. layout*lv*Latvia
  636. variant*lv**Latvia
  637. variant*lv*tilde*Latvia - Tilde (~) variant
  638. variant*lv*fkey*Latvia - F-letter (F) variant
  639. variant*lv*apostrophe*Latvia - Apostrophe () variant
  640. layout*tr*Turkey
  641. variant*tr**Turkey
  642. variant*tr*sundeadkeys*Turkey - Sun dead keys
  643. variant*tr*ku*Turkey - Kurdish, Latin Q
  644. variant*tr*intl*Turkey - International (with dead keys)
  645. variant*tr*alt*Turkey - Alt-Q
  646. variant*tr*ku_alt*Turkey - Kurdish, Latin Alt-Q
  647. variant*tr*f*Turkey - (F)
  648. variant*tr*ku_f*Turkey - Kurdish, (F)
  649. layout*is*Iceland
  650. variant*is**Iceland
  651. variant*is*Sundeadkeys*Iceland - Sun dead keys
  652. variant*is*nodeadkeys*Iceland - Eliminate dead keys
  653. variant*is*mac*Iceland - Macintosh
  654. layout*rs*Serbia
  655. variant*rs**Serbia
  656. variant*rs*latinyz*Serbia - Latin qwerty
  657. variant*rs*latin*Serbia - Latin
  658. variant*rs*alternatequotes*Serbia - With guillemets
  659. variant*rs*yz*Serbia - Z and ZHE swapped
  660. variant*rs*latinunicodeyz*Serbia - Latin Unicode qwerty
  661. variant*rs*latinalternatequotes*Serbia - Latin with guillemets
  662. variant*rs*latinunicode*Serbia - Latin Unicode
  663. layout*gh*Ghana
  664. variant*gh**Ghana
  665. variant*gh*hausa*Ghana - Hausa
  666. variant*gh*ewe*Ghana - Ewe
  667. variant*gh*generic*Ghana - Multilingual
  668. variant*gh*ga*Ghana - Ga
  669. variant*gh*fula*Ghana - Fula
  670. variant*gh*akan*Ghana - Akan
  671. layout*ma*Morocco
  672. variant*ma**Morocco
  673. variant*ma*tifinagh-phonetic*Morocco - Tifinagh Phonetic
  674. variant*ma*tifinagh-extended-phonetic*Morocco - Tifinagh Extended Phonetic
  675. variant*ma*tifinagh-extended*Morocco - Tifinagh Extended
  676. variant*ma*tifinagh*Morocco - Tifinagh
  677. variant*ma*french*Morocco - French
  678. variant*ma*tifinagh-alt-phonetic*Morocco - Tifinagh Alternative Phonetic
  679. variant*ma*tifinagh-alt*Morocco - Tifinagh Alternative
  680. layout*fo*Faroe Islands
  681. variant*fo**Faroe Islands
  682. variant*fo*nodeadkeys*Faroe Islands - Eliminate dead keys
  683. layout*mv*Maldives
  684. variant*mv**Maldives
  685. layout*bd*Bangladesh
  686. variant*bd**Bangladesh
  687. variant*bd*probhat*Bangladesh - Probhat
  688. layout*nl*Netherlands
  689. variant*nl**Netherlands
  690. variant*nl*sundeadkeys*Netherlands - Sun dead keys
  691. variant*nl*std*Netherlands - Standard
  692. variant*nl*mac*Netherlands - Macintosh
  693. layout*br*Brazil
  694. variant*br**Brazil
  695. variant*br*thinkpad*Brazil - Thinkpad
  696. variant*br*dvorak*Brazil - Dvorak
  697. variant*br*nativo-us*Brazil - Nativo for USA keyboards
  698. variant*br*nativo-epo*Brazil - Nativo for Esperanto
  699. variant*br*nodeadkeys*Brazil - Eliminate dead keys
  700. variant*br*nativo*Brazil - Nativo
  701. layout*jp*Japan
  702. variant*jp**Japan
  703. variant*jp*kana*Japan - Kana
  704. variant*jp*OADG109A*Japan - OADG 109A
  705. layout*sk*Slovakia
  706. variant*sk**Slovakia
  707. variant*sk*qwerty*Slovakia - qwerty
  708. variant*sk*bksl*Slovakia - Extended Backslash
  709. variant*sk*qwerty_bksl*Slovakia - qwerty, extended Backslash
  710. layout*cd*Congo, Democratic Republic of the
  711. variant*cd**Congo, Democratic Republic of the
  712. layout*tj*Tajikistan
  713. variant*tj**Tajikistan
  714. layout*hr*Croatia
  715. variant*hr**Croatia
  716. variant*hr*unicodeus*Croatia - US keyboard with Croatian digraphs
  717. variant*hr*unicode*Croatia - Use Croatian digraphs
  718. variant*hr*alternatequotes*Croatia - Use guillemets for quotes
  719. variant*hr*us*Croatia - US keyboard with Croatian letters
  720. layout*pl*Poland
  721. variant*pl**Poland
  722. variant*pl*ru_phonetic_dvorak*Poland - Russian phonetic Dvorak
  723. variant*pl*csb*Poland - Kashubian
  724. variant*pl*dvorak_altquotes*Poland - Dvorak, Polish quotes on key "1/!"
  725. variant*pl*dvorak*Poland - Dvorak
  726. variant*pl*qwertz*Poland - qwertz
  727. variant*pl*dvorak_quotes*Poland - Dvorak, Polish quotes on quotemark key
  728. layout*si*Slovenia
  729. variant*si**Slovenia
  730. variant*si*us*Slovenia - US keyboard with Slovenian letters
  731. variant*si*unicodeus*Slovenia - US keyboard with Slovenian digraphs
  732. variant*si*alternatequotes*Slovenia - Use guillemets for quotes
  733. variant*si*unicode*Slovenia - Use Slovenian digraphs
  734. layout*il*Israel
  735. variant*il**Israel
  736. variant*il*biblical*Israel - Biblical Hebrew (Tiro)
  737. variant*il*lyx*Israel - lyx
  738. variant*il*phonetic*Israel - Phonetic
  739. layout*in*India
  740. variant*in**India
  741. variant*in*urd*India - Urdu
  742. variant*in*guru*India - Gurmukhi
  743. variant*in*guj*India - Gujarati
  744. variant*in*bolnagri*India - Hindi Bolnagri
  745. variant*in*jhelum*India - Gurmukhi Jhelum
  746. variant*in*kan*India - Kannada
  747. variant*in*mal*India - Malayalam
  748. variant*in*mal_lalitha*India - Malayalam Lalitha
  749. variant*in*tam_unicode*India - Tamil Unicode
  750. variant*in*tam*India - Tamil
  751. variant*in*ben*India - Bengali
  752. variant*in*tam_TSCII*India - Tamil TSCII Typewriter
  753. variant*in*tel*India - Telugu
  754. variant*in*ori*India - Oriya
  755. variant*in*tam_TAB*India - Tamil TAB Typewriter
  756. variant*in*ben_probhat*India - Bengali Probhat
  757. layout*mt*Malta
  758. variant*mt**Malta
  759. variant*mt*us*Malta - Maltese keyboard with US layout
  760. layout*es*Spain
  761. variant*es**Spain
  762. variant*es*dvorak*Spain - Dvorak
  763. variant*es*sundeadkeys*Spain - Sun dead keys
  764. variant*es*nodeadkeys*Spain - Eliminate dead keys
  765. variant*es*cat*Spain - Catalan variant with middle-dot L
  766. variant*es*mac*Spain - Macintosh
  767. variant*es*ast*Spain - Asturian variant with bottom-dot H and bottom-dot L
  768. layout*mk*Macedonia
  769. variant*mk**Macedonia
  770. variant*mk*nodeadkeys*Macedonia - Eliminate dead keys
  771. layout*gb*United Kingdom
  772. variant*gb**United Kingdom
  773. variant*gb*dvorak*United Kingdom - Dvorak
  774. variant*gb*intl*United Kingdom - International (with dead keys)
  775. variant*gb*mac*United Kingdom - Macintosh
  776. layout*ch*Switzerland
  777. variant*ch**Switzerland
  778. variant*ch*fr_sundeadkeys*Switzerland - French, Sun dead keys
  779. variant*ch*fr_mac*Switzerland - French (Macintosh)
  780. variant*ch*fr*Switzerland - French
  781. variant*ch*fr_nodeadkeys*Switzerland - French, eliminate dead keys
  782. variant*ch*de_sundeadkeys*Switzerland - German, Sun dead keys
  783. variant*ch*de_nodeadkeys*Switzerland - German, eliminate dead keys
  784. variant*ch*de_mac*Switzerland - German (Macintosh)
  785. layout*az*Azerbaijan
  786. variant*az**Azerbaijan
  787. variant*az*cyrillic*Azerbaijan - Cyrillic
  788. layout*bg*Bulgaria
  789. variant*bg**Bulgaria
  790. variant*bg*phonetic*Bulgaria - Phonetic
  791. layout*la*Laos
  792. variant*la**Laos
  793. layout*lt*Lithuania
  794. variant*lt**Lithuania
  795. variant*lt*us*Lithuania - US keyboard with Lithuanian letters
  796. variant*lt*lekp*Lithuania - LEKP
  797. variant*lt*lekpa*Lithuania - LEKPa
  798. variant*lt*std*Lithuania - Standard
  799. variant*lt*ibm*Lithuania - IBM (LST 1205-92)
  800. variant*lt*balticplus*Lithuania - Baltic+
  801. layout*no*Norway
  802. variant*no**Norway
  803. variant*no*mac_nodeadkeys*Norway - Macintosh, eliminate dead keys
  804. variant*no*dvorak*Norway - Dvorak
  805. variant*no*smi_nodeadkeys*Norway - Northern Saami, eliminate dead keys
  806. variant*no*nodeadkeys*Norway - Eliminate dead keys
  807. variant*no*smi*Norway - Northern Saami
  808. variant*no*mac*Norway - Macintosh
  809. layout*ca*Canada
  810. variant*ca**Canada
  811. variant*ca*multi*Canada - Multilingual, first part
  812. variant*ca*fr-dvorak*Canada - French Dvorak
  813. variant*ca*shs*Canada - Secwepemctsin
  814. variant*ca*multix*Canada - Multilingual
  815. variant*ca*multi-2gr*Canada - Multilingual, second part
  816. variant*ca*ike*Canada - Inuktitut
  817. variant*ca*fr-legacy*Canada - French (legacy)
  818. layout*iq*Iraq
  819. variant*iq**Iraq
  820. variant*iq*ku*Iraq - Kurdish, Latin Q
  821. variant*iq*ku_ara*Iraq - Kurdish, Arabic-Latin
  822. variant*iq*ku_alt*Iraq - Kurdish, Latin Alt-Q
  823. variant*iq*ku_f*Iraq - Kurdish, (F)
  824. layout*me*Montenegro
  825. variant*me**Montenegro
  826. variant*me*cyrillic*Montenegro - Cyrillic
  827. variant*me*latinunicode*Montenegro - Latin unicode
  828. variant*me*latinyz*Montenegro - Latin qwerty
  829. variant*me*latinalternatequotes*Montenegro - Latin with guillemets
  830. variant*me*cyrillicyz*Montenegro - Cyrillic, Z and ZHE swapped
  831. variant*me*latinunicodeyz*Montenegro - Latin unicode qwerty
  832. variant*me*cyrillicalternatequotes*Montenegro - Cyrillic with guillemets
  833. layout*th*Thailand
  834. variant*th**Thailand
  835. variant*th*pat*Thailand - Pattachote
  836. variant*th*tis*Thailand - TIS-820.2538
  837. layout*ara*Arabic
  838. variant*ara**Arabic
  839. variant*ara*qwerty*Arabic - qwerty
  840. variant*ara*azerty*Arabic - azerty
  841. variant*ara*azerty_digits*Arabic - azerty/digits
  842. variant*ara*buckwalter*Arabic - Buckwalter
  843. variant*ara*qwerty_digits*Arabic - qwerty/digits
  844. variant*ara*digits*Arabic - digits
  845. layout*epo*Esperanto
  846. variant*epo**Esperanto
  847. variant*epo*legacy*Esperanto - displaced semicolon and quote (obsolete)
  848. layout*ir*Iran
  849. variant*ir**Iran
  850. variant*ir*pro_keypad*Iran - Pro Keypad
  851. variant*ir*keypad*Iran - Keypad
  852. variant*ir*pro*Iran - Pro
  853. variant*ir*ku*Iran - Kurdish, Latin Q
  854. variant*ir*ku_ara*Iran - Kurdish, Arabic-Latin
  855. variant*ir*ku_alt*Iran - Kurdish, Latin Alt-Q
  856. variant*ir*ku_f*Iran - Kurdish, (F)
  857. layout*by*Belarus
  858. variant*by**Belarus
  859. variant*by*winkeys*Belarus - Winkeys
  860. variant*by*latin*Belarus - Latin
  861. layout*vn*Vietnam
  862. variant*vn**Vietnam
  863. layout*kg*Kyrgyzstan
  864. variant*kg**Kyrgyzstan
  865. layout*ua*Ukraine
  866. variant*ua**Ukraine
  867. variant*ua*winkeys*Ukraine - Winkeys
  868. variant*ua*unicode*Ukraine - Unicode
  869. variant*ua*rstu_ru*Ukraine - Standard RSTU on Russian layout
  870. variant*ua*typewriter*Ukraine - Typewriter
  871. variant*ua*rstu*Ukraine - Standard RSTU
  872. variant*ua*phonetic*Ukraine - Phonetic
  873. variant*ua*homophonic*Ukraine - Homophonic
  874. layout*ru*Russia
  875. variant*ru**Russia
  876. variant*ru*os_legacy*Russia - Ossetian, legacy
  877. variant*ru*udm*Russia - Udmurt
  878. variant*ru*os_winkeys*Russia - Ossetian, Winkeys
  879. variant*ru*cv_latin*Russia - Chuvash Latin
  880. variant*ru*kom*Russia - Komi
  881. variant*ru*phonetic*Russia - Phonetic
  882. variant*ru*legacy*Russia - Legacy
  883. variant*ru*cv*Russia - Chuvash
  884. variant*ru*typewriter*Russia - Typewriter
  885. variant*ru*tt*Russia - Tatar
  886. layout*fi*Finland
  887. variant*fi**Finland
  888. variant*fi*classic*Finland - Classic
  889. variant*fi*nodeadkeys*Finland - Eliminate dead keys
  890. variant*fi*smi*Finland - Northern Saami
  891. variant*fi*mac*Finland - Macintosh
  892. layout*ro*Romania
  893. variant*ro**Romania
  894. variant*ro*std_cedilla*Romania - Standard (Cedilla)
  895. variant*ro*winkeys*Romania - Winkeys
  896. variant*ro*std*Romania - Standard
  897. variant*ro*cedilla*Romania - Cedilla
  898. layout*kz*Kazakhstan
  899. variant*kz**Kazakhstan
  900. variant*kz*kazrus*Kazakhstan - Kazakh with Russian
  901. variant*kz*ruskaz*Kazakhstan - Russian with Kazakh
  902. layout*gr*Greece
  903. variant*gr**Greece
  904. variant*gr*extended*Greece - Extended
  905. variant*gr*nodeadkeys*Greece - Eliminate dead keys
  906. variant*gr*polytonic*Greece - Polytonic
  907. layout*it*Italy
  908. variant*it**Italy
  909. variant*it*nodeadkeys*Italy - Eliminate dead keys
  910. variant*it*mac*Italy - Macintosh
  911. variant*it*geo*Italy - Georgian
  912. layout*de*Germany
  913. variant*de**Germany
  914. variant*de*dvorak*Germany - Dvorak
  915. variant*de*sundeadkeys*Germany - Sun dead keys
  916. variant*de*deadgraveacute*Germany - Dead grave acute
  917. variant*de*ro*Germany - Romanian keyboard with German letters
  918. variant*de*deadacute*Germany - Dead acute
  919. variant*de*ro_nodeadkeys*Germany - Romanian keyboard with German letters, eliminate dead keys
  920. variant*de*mac_nodeadkeys*Germany - Macintosh, eliminate dead keys
  921. variant*de*nodeadkeys*Germany - Eliminate dead keys
  922. variant*de*neo*Germany - Neostyle
  923. variant*de*mac*Germany - Macintosh
  924. layout*bt*Bhutan
  925. variant*bt**Bhutan
  926. layout*be*Belgium
  927. variant*be**Belgium
  928. variant*be*sundeadkeys*Belgium - Sun dead keys
  929. variant*be*nodeadkeys*Belgium - Eliminate dead keys
  930. variant*be*wang*Belgium - Wang model 724 azerty
  931. variant*be*iso-alternate*Belgium - ISO Alternate
  932. layout*braille*Braille
  933. variant*braille**Braille
  934. variant*braille*left_hand*Braille - Left hand
  935. variant*braille*right_hand*Braille - Right hand
  936. layout*uz*Uzbekistan
  937. variant*uz**Uzbekistan
  938. variant*uz*latin*Uzbekistan - Latin
  939. layout*us*USA
  940. variant*us**USA
  941. variant*us*dvorak*USA - Dvorak
  942. variant*us*alt-intl*USA - Alternative international (former us_intl)
  943. variant*us*dvp*USA - Programmer Dvorak
  944. variant*us*colemak*USA - Colemak
  945. variant*us*dvorak-classic*USA - Classic Dvorak
  946. variant*us*dvorak-intl*USA - Dvorak international
  947. variant*us*euro*USA - With EuroSign on 5
  948. variant*us*olpc2*USA - Group toggle on multiply/divide key
  949. variant*us*altgr-intl*USA - International (AltGr dead keys)
  950. variant*us*rus*USA - Russian phonetic
  951. variant*us*intl*USA - International (with dead keys)
  952. variant*us*dvorak-l*USA - Left handed Dvorak
  953. variant*us*dvorak-r*USA - Right handed Dvorak
  954. variant*us*mac*USA - Macintosh
  955. layout*cz*Czechia
  956. variant*cz**Czechia
  957. variant*cz*qwerty*Czechia - qwerty
  958. variant*cz*qwerty_bksl*Czechia - qwerty, extended Backslash
  959. variant*cz*bksl*Czechia - With <\|> key
  960. layout*mm*Myanmar
  961. variant*mm**Myanmar
  962. layout*fr*France
  963. variant*fr**France
  964. variant*fr*oss_latin9*France - Alternative, latin-9 only
  965. variant*fr*sundeadkeys*France - Sun dead keys
  966. variant*fr*oss_nodeadkeys*France - Alternative, eliminate dead keys
  967. variant*fr*bepo*France - Bepo, ergonomic, Dvorak way
  968. variant*fr*latin9_nodeadkeys*France - (Legacy) Alternative, eliminate dead keys
  969. variant*fr*geo*France - Georgian AZERTY Tskapo
  970. variant*fr*bepo_latin9*France - Bepo, ergonomic, Dvorak way, latin-9 only
  971. variant*fr*dvorak*France - (Legacy) Dvorak
  972. variant*fr*nodeadkeys*France - Eliminate dead keys
  973. variant*fr*latin9*France - (Legacy) Alternative
  974. variant*fr*latin9_sundeadkeys*France - (Legacy) Alternative, Sun dead keys
  975. variant*fr*oss*France - Alternative
  976. variant*fr*oss_sundeadkeys*France - Alternative, Sun dead keys
  977. variant*fr*mac*France - Macintosh
  978. layout*ba*Bosnia and Herzegovina
  979. variant*ba**Bosnia and Herzegovina
  980. variant*ba*unicode*Bosnia and Herzegovina - Use Bosnian digraphs
  981. variant*ba*us*Bosnia and Herzegovina - US keyboard with Bosnian letters
  982. variant*ba*unicodeus*Bosnia and Herzegovina - US keyboard with Bosnian digraphs
  983. variant*ba*alternatequotes*Bosnia and Herzegovina - Use guillemets for quotes
  984. layout*ge*Georgia
  985. variant*ge**Georgia
  986. variant*ge*ru*Georgia - Russian
  987. variant*ge*mess*Georgia - MESS
  988. variant*ge*ergonomic*Georgia - Ergonomic
  989. variant*ge*os*Georgia - Ossetian
  990. layout*kh*Cambodia
  991. variant*kh**Cambodia
  992. layout*af*Afghanistan
  993. variant*af**Afghanistan
  994. variant*af*olpc-ps*Afghanistan - OLPC Pashto
  995. variant*af*ps*Afghanistan - Pashto
  996. variant*af*olpc-uz*Afghanistan - OLPC Southern Uzbek
  997. variant*af*uz*Afghanistan - Southern Uzbek
  998. variant*af*olpc-fa*Afghanistan - OLPC Dari
  999. layout*dk*Denmark
  1000. variant*dk**Denmark
  1001. variant*dk*mac_nodeadkeys*Denmark - Macintosh, eliminate dead keys
  1002. variant*dk*dvorak*Denmark - Dvorak
  1003. variant*dk*nodeadkeys*Denmark - Eliminate dead keys
  1004. variant*dk*mac*Denmark - Macintosh
  1005. layout*ad*Andorra
  1006. variant*ad**Andorra
  1007. layout*al*Albania
  1008. variant*al**Albania
  1009. '
  1010. # kbdnames='model*logicdp*Logitech Cordless Desktop Pro
  1011. # model*omnikey101*Northgate OmniKey 101
  1012. # ...
  1013. # layout*el*Greek
  1014. # ...
  1015. # variant*it*nodeadkeys*Eliminate dead keys'
  1016.  
  1017. ## CODESETS ##
  1018.  
  1019. codesets='Arabic*. Arabic
  1020. Armenian*# Armenian
  1021. CyrKoi*# Cyrillic - KOI8-R and KOI8-U
  1022. CyrAsia*# Cyrillic - non-Slavic languages
  1023. CyrSlav*# Cyrillic - Slavic languages (also Bosnian and Serbian Latin)
  1024. Ethiopian*. Ethiopic
  1025. Georgian*# Georgian
  1026. Greek*# Greek
  1027. Hebrew*# Hebrew
  1028. Lao*# Lao
  1029. Lat15*# Latin1 and Latin5 - western Europe and Turkic languages
  1030. Lat2*# Latin2 - central Europe and Romanian
  1031. Lat38*# Latin3 and Latin8 - Chichewa; Esperanto; Irish; Maltese and Welsh
  1032. Lat7*# Latin7 - Lithuanian; Latvian; Maori and Marshallese
  1033. Vietnamese*. Latin - Vietnamese
  1034. Thai*# Thai
  1035. Uni1*. Combined - Latin; Slavic Cyrillic; Hebrew; basic Arabic
  1036. Uni2*. Combined - Latin; Slavic Cyrillic; Greek
  1037. Uni3*. Combined - Latin; Slavic and non-Slavic Cyrillic'
  1038.  
  1039. db_capb backup
  1040. CAPB="$RET"
  1041. detect_keyboard=false
  1042. case $CAPB in
  1043.     *plugin-detect-keyboard*)
  1044.     detect_keyboard=:
  1045.     ;;
  1046. esac
  1047.  
  1048. # Set default value for a question only if it is not seen by the user
  1049. db_default () {
  1050.     if \
  1051.     [ -f $CONFIGFILE ] \
  1052.     || { db_fget $1 seen && [ "$RET" = false ]; }
  1053.     then
  1054.     db_set $1 "$2"
  1055.     fi
  1056. }
  1057.  
  1058. # A high level function to ask questions about the keyboard model,
  1059. # layout and variant
  1060. ask_debconf () {
  1061.     local template priority prefix default_code default_description choices
  1062.  
  1063.     template=$1     # The template to ask
  1064.     priority=$2     # The priority for the question
  1065.     prefix=$3       # The prefix for $kbdnames
  1066.     default_code=$4 # The default choice (optional)
  1067.     choices=`echo "$kbdnames" | grep "^$prefix\*" | 
  1068.         sed -e "s/^$prefix\*[^\*]*\*//" -e 's/,/\\\\,/g' -e 's/$/,/' | LC_ALL=C sort `
  1069.     choices=`echo $choices | sed 's/, *$//'`
  1070.  
  1071.     db_subst $template CHOICES "$choices"
  1072.     default_description=`echo "$kbdnames" |  
  1073.         grep "^$prefix\*${default_code}\*" |
  1074.         sed -e "s/^$prefix\*${default_code}\*//"`
  1075.     if [ -z "$default_description" ]; then
  1076.     # Vor XkbVariant the empty string is usualy a sensible default
  1077.     default_description=`echo "$kbdnames" |  
  1078.             grep "^$prefix\*\*" |
  1079.             sed -e "s/^$prefix\*\*//"`
  1080.     fi
  1081.     if [ -n "$default_description" ]; then
  1082.     db_default $template "$default_description"
  1083.     fi
  1084.  
  1085.     db_input $priority $template || true
  1086.     db_go || return 255
  1087.     db_get $template
  1088.     RET=`echo "$kbdnames" | grep "^$prefix\*[^\*]*\*" |
  1089.              sed 's/  */ /g' |
  1090.              grep "\*$RET\$" |
  1091.              sed -e "s/^$prefix\*\([^\*]*\)\*.*/\1/" `
  1092.     return 0
  1093. }
  1094.  
  1095. # The guess arch code is taken from "console-data.conf"
  1096. # (translated from Perl to shell)
  1097.  
  1098. # SUBARCH    KEYMAP SET    DETECTION
  1099. # m68k/atari    atari        "Model: Atari"
  1100. # m68k/amiga    amiga        "Model: Amiga"
  1101. # m68k/mac    mac        "Model: Macintosh"
  1102. # m68k/mvme    pc        "Model: Motorola"
  1103. # m68k/bvme    pc        "Model: BVME[46]000"
  1104. # m68k/{sun,apollo,next,q40,hp300} Not supported by Debian
  1105.  
  1106. # ppc/apus    amiga        "machine: Amiga"
  1107. # ppc/chrp    pc,mac        "machine: CHRP"
  1108. # ppc/pmac    mac        "machine: PowerMac|[Pp]ower[Bb]ook*|Power|iMac*|PowerMac1*"
  1109. # ppc/prep    pc        "machine: PReP"
  1110. # ppc/ps3    pc        "platform: PS3"
  1111. # ppc/cell    pc        "platform: Cell"
  1112. # ppc/{bbox,mbx,ppc64,82xx,8xx} Not yet supported by Debian
  1113.  
  1114. # arm/*        pc        (refered to as 'arm' only)
  1115.  
  1116. guess_arch () {
  1117.     local arch subarch line
  1118.  
  1119.     if which archdetect >/dev/null; then
  1120.     archdetect
  1121.     return 0
  1122.     fi
  1123.  
  1124.     arch=`dpkg --print-installation-architecture`
  1125.     
  1126.     if [ "$arch" = 'powerpc' -o "$arch" = 'm68k' ]; then
  1127.     if [ "$arch" = powerpc ]; then
  1128.         line=`sed -n 's/^platform.*: *//p' /proc/cpuinfo`
  1129.         if [ "$line" = PS3 ] || [ "$line" = Cell ]; then
  1130.         subarch=`echo $line|tr A-Z a-z`
  1131.         else
  1132.         line=`sed -n 's/^machine.*: *//p' /proc/cpuinfo`
  1133.         if [ "$line" = '' ]; then
  1134.             echo unknown
  1135.             return 0
  1136.         fi
  1137.         subarch=`echo $line|tr A-Z a-z`
  1138.         fi
  1139.     elif [ "$arch" = m68k ]; then
  1140.         line=`sed -n 's/^Model.*: *//p' /proc/hardware`
  1141.         if [ "$line" = '' ]; then
  1142.         echo unknown
  1143.         return 0
  1144.         fi
  1145.         subarch=`echo $line|tr A-Z a-z`
  1146.     fi
  1147.     case "$subarch" in
  1148.         *amiga*)
  1149.         subarch=amiga
  1150.         ;;
  1151.         *chrp*)
  1152.         subarch=chrp
  1153.         ;;
  1154.         *prep*)
  1155.         subarch=prep
  1156.         ;;
  1157.         *macintosh*|*powermac*|*powerbook*|*power*|*imac*|*powermac1*)
  1158.         subarch=mac
  1159.         ;;
  1160.         *atari*)
  1161.         subarch=atari
  1162.         ;;
  1163.         *motorola*)
  1164.         subarch=mvme
  1165.         ;;
  1166.         *bvme*)
  1167.         subarch=bvme
  1168.         ;;
  1169.         *)
  1170.         subarch=`echo $subarch|sed  's/^\s*//'`
  1171.         ;;
  1172.     esac
  1173.     arch="$arch/$subarch"
  1174.     fi
  1175.     echo $arch
  1176.     return 0
  1177. }
  1178.  
  1179. available_fontfaces () {
  1180.     echo "$fontsets" | LC_ALL=C sort | \
  1181.     grep "^$codeset-" | \
  1182.     sed -e "s/^$codeset-//" \
  1183.         -e 's/[0-9][0-9]*x[0-9][0-9]*$//' \
  1184.         -e 's/[0-9]*$//' | \
  1185.     uniq
  1186. }
  1187.  
  1188. available_fontsizes () {
  1189.     echo "$fontsets" | LC_ALL=C sort | \
  1190.     grep "^$codeset-$fontface[0-9]" | \
  1191.     sed -e "s/^$codeset-$fontface//" | \
  1192.     uniq
  1193. }
  1194.  
  1195. decode_codeset () {
  1196.     pattern="^$(echo "$*" | sed 's/[^ #0-9;A-Za-z-]/\\&/g')\\*"
  1197.     echo "$codesets" | \
  1198.     grep "$pattern" | \
  1199.     sed 's/.*[*]//'
  1200. }
  1201.  
  1202. encode_codeset () {
  1203.     pattern="\\*$(echo "$*" | sed 's/[^ #0-9;A-Za-z-]/\\&/g')\$"
  1204.     echo "$codesets" | \
  1205.     grep "$pattern" | \
  1206.     sed 's/[*].*//'
  1207. }
  1208.  
  1209. if which locale >/dev/null; then
  1210.     eval `locale`
  1211. fi
  1212.  
  1213. if [ "$LC_CTYPE"  -a "$LC_CTYPE" != C ]; then
  1214.     locale=$LC_CTYPE
  1215. elif db_get debian-installer/locale && [ "$RET" ]; then
  1216.     locale="$RET"
  1217. else
  1218.     locale=C
  1219. fi
  1220.  
  1221. case "$locale" in
  1222.     *KOI8*|*koi8*)
  1223.     default_codeset=CyrKoi
  1224.     codeset_priority=low
  1225.     ;;
  1226.     aa_*)
  1227.     default_codeset=Lat15
  1228.     codeset_priority=low
  1229.     ;;
  1230.     af_*)
  1231.     default_codeset=Lat15
  1232.     codeset_priority=low
  1233.     ;;
  1234.     am_*)
  1235.     default_codeset=Ethiopic
  1236.     codeset_priority=low
  1237.     ;;
  1238.     an_*)
  1239.     default_codeset=Lat15
  1240.     codeset_priority=low
  1241.     ;;
  1242.     ar_*)
  1243.     default_codeset=Arabic
  1244.     codeset_priority=low
  1245.     ;;
  1246.     az_*)
  1247.     default_codeset=Uni3
  1248.     codeset_priority=low
  1249.     ;;
  1250.     be_*)
  1251.     default_codeset=CyrSlav
  1252.     codeset_priority=low
  1253.     ;;
  1254.     bg_*)
  1255.     default_codeset=CyrSlav
  1256.     codeset_priority=low
  1257.     ;;
  1258.     bn_*)
  1259.     default_codeset=unsupported
  1260.     codeset_priority=low
  1261.     ;;
  1262.     br_*)
  1263.     default_codeset=Lat15
  1264.     codeset_priority=low
  1265.     ;;
  1266.     bs_*)
  1267.     default_codeset=Uni3
  1268.     codeset_priority=low
  1269.     ;;
  1270.     byn_*)
  1271.     default_codeset=Ethiopian
  1272.     codeset_priority=low
  1273.     ;;
  1274.     ca_*)
  1275.     default_codeset=Lat15
  1276.     codeset_priority=low
  1277.     ;;
  1278.     cs_*)
  1279.     default_codeset=Lat2
  1280.     codeset_priority=low
  1281.     ;;
  1282.     cy_*)
  1283.     default_codeset=Lat38
  1284.     codeset_priority=low
  1285.     ;;
  1286.     da_*)
  1287.     default_codeset=Lat15
  1288.     codeset_priority=low
  1289.     ;;
  1290.     de_*)
  1291.     default_codeset=Lat15
  1292.     codeset_priority=low
  1293.     ;;
  1294.     el_*)
  1295.     default_codeset=Greek
  1296.     codeset_priority=low
  1297.     ;;
  1298.     en_*)
  1299.     default_codeset=Lat15
  1300.     codeset_priority=low
  1301.     ;;
  1302.     eo|eo.*|eo_*|eo\@*)
  1303.     default_codeset=Lat38
  1304.     codeset_priority=low
  1305.     ;;
  1306.     es_*)
  1307.     default_codeset=Lat15
  1308.     codeset_priority=low
  1309.     ;;
  1310.     et_*)
  1311.     default_codeset=Lat15
  1312.     codeset_priority=low
  1313.     ;;
  1314.     eu_*)
  1315.     default_codeset=Lat15
  1316.     codeset_priority=low
  1317.     ;;
  1318.     fa_*)
  1319.     default_codeset=Arabic
  1320.     codeset_priority=low
  1321.     ;;
  1322.     fi_*)
  1323.     default_codeset=Lat15
  1324.     codeset_priority=low
  1325.     ;;
  1326.     fo_*)
  1327.     default_codeset=Lat15
  1328.     codeset_priority=low
  1329.     ;;
  1330.     fr_*)
  1331.     default_codeset=Lat15
  1332.     codeset_priority=low
  1333.     ;;
  1334.     ga_*)
  1335.     default_codeset=Lat38
  1336.     codeset_priority=low
  1337.     ;;
  1338.     gd_*)
  1339.     default_codeset=Lat15
  1340.     codeset_priority=low
  1341.     ;;
  1342.     gez_*)
  1343.     default_codeset=Ethiopian
  1344.     codeset_priority=low
  1345.     ;;
  1346.     gl_*)
  1347.     default_codeset=Lat15
  1348.     codeset_priority=low
  1349.     ;;
  1350.     gu_*)
  1351.     default_codeset=unsupported
  1352.     codeset_priority=low
  1353.     ;;
  1354.     gv_*)
  1355.     default_codeset=Lat15
  1356.     codeset_priority=low
  1357.     ;;
  1358.     he_*)
  1359.     default_codeset=Hebrew
  1360.     codeset_priority=low
  1361.     ;;
  1362.     hi_*)
  1363.     default_codeset=unsupported
  1364.     codeset_priority=low
  1365.     ;;
  1366.     hr_*)
  1367.     default_codeset=Lat2
  1368.     codeset_priority=low
  1369.     ;;
  1370.     hu_*)
  1371.     default_codeset=Lat2
  1372.     codeset_priority=low
  1373.     ;;
  1374.     hy_*)
  1375.     default_codeset=Armenian
  1376.     codeset_priority=low
  1377.     ;;
  1378.     id_*)
  1379.     default_codeset=Lat15
  1380.     codeset_priority=low
  1381.     ;;
  1382.     is_*)
  1383.     default_codeset=Lat15
  1384.     codeset_priority=low
  1385.     ;;
  1386.     it_*)
  1387.     default_codeset=Lat15
  1388.     codeset_priority=low
  1389.     ;;
  1390.     iw_*)
  1391.     default_codeset=Hebrew
  1392.     codeset_priority=low
  1393.     ;;
  1394.     ja_*)
  1395.     default_codeset=unsupported
  1396.     codeset_priority=low
  1397.     ;;
  1398.     ka_*)
  1399.     default_codeset=Georgian
  1400.     codeset_priority=low
  1401.     ;;
  1402.     kl_*)
  1403.     default_codeset=Lat15
  1404.     codeset_priority=low
  1405.     ;;
  1406.     kn_*)
  1407.     default_codeset=unsupported
  1408.     codeset_priority=low
  1409.     ;;
  1410.     ko_*)
  1411.     default_codeset=unsupported
  1412.     codeset_priority=low
  1413.     ;;
  1414.     kw_*)
  1415.     default_codeset=Lat15
  1416.     codeset_priority=low
  1417.     ;;
  1418.     lg_*)
  1419.     default_codeset=Lat15 # TODO: This must be ISO-8859-10 (Latin6)
  1420.     codeset_priority=low
  1421.     ;;
  1422.     lo_*)
  1423.     default_codeset=Lao
  1424.     codeset_priority=low
  1425.     ;;
  1426.     lt_*)
  1427.     default_codeset=Lat7
  1428.     codeset_priority=low
  1429.     ;;
  1430.     lv_*)
  1431.     default_codeset=Lat7
  1432.     codeset_priority=low
  1433.     ;;
  1434.     mi_*)
  1435.     default_codeset=Lat7
  1436.     codeset_priority=low
  1437.     ;;
  1438.     mk_*)
  1439.     default_codeset=CyrSlav
  1440.     codeset_priority=low
  1441.     ;;
  1442.     ml_*)
  1443.     default_codeset=unsupported
  1444.     codeset_priority=low
  1445.     ;;
  1446.     mn_*)
  1447.     default_codeset=CyrAsia
  1448.     codeset_priority=low
  1449.     ;;
  1450.     mr_*)
  1451.     default_codeset=unsupported
  1452.     codeset_priority=low
  1453.     ;;
  1454.     ms_*)
  1455.     default_codeset=Lat15 # TODO: Is this correct? (Malay language)
  1456.     codeset_priority=low
  1457.     ;;
  1458.     mt_*)
  1459.     default_codeset=Lat38
  1460.     codeset_priority=low
  1461.     ;;
  1462.     nb_*)
  1463.     default_codeset=Lat15
  1464.     codeset_priority=low
  1465.     ;;
  1466.     ne_*)
  1467.     default_codeset=unsupported
  1468.     codeset_priority=low
  1469.     ;;
  1470.     nl_*)
  1471.     default_codeset=Lat15
  1472.     codeset_priority=low
  1473.     ;;
  1474.     nn_*)
  1475.     default_codeset=Lat15
  1476.     codeset_priority=low
  1477.     ;;
  1478.     oc_*)
  1479.     default_codeset=Lat15
  1480.     codeset_priority=low
  1481.     ;;
  1482.     om_*)
  1483.     default_codeset=Lat15
  1484.     codeset_priority=low
  1485.     ;;
  1486.     pa_*)
  1487.     default_codeset=unsupported
  1488.     codeset_priority=low
  1489.     ;;
  1490.     pl_*)
  1491.     default_codeset=Lat2
  1492.     codeset_priority=low
  1493.     ;;
  1494.     pt_*)
  1495.     default_codeset=Lat15
  1496.     codeset_priority=low
  1497.     ;;
  1498.     ro_*)
  1499.     default_codeset=Lat2
  1500.     codeset_priority=low
  1501.     ;;
  1502.     ru_*)
  1503.     default_codeset=CyrSlav
  1504.     codeset_priority=low
  1505.     ;;
  1506.     se_*)
  1507.     default_codeset=Uni1
  1508.     codeset_priority=low
  1509.     ;;
  1510.     sid_*)
  1511.     default_codeset=Lat15 # TODO: Is this correct? (Sidama language)
  1512.     codeset_priority=low
  1513.     ;;
  1514.     sk_*)
  1515.     default_codeset=Lat2
  1516.     codeset_priority=low
  1517.     ;;
  1518.     sl_*)
  1519.     default_codeset=Lat2
  1520.     codeset_priority=low
  1521.     ;;
  1522.     so_*)
  1523.     default_codeset=Lat15
  1524.     codeset_priority=low
  1525.     ;;
  1526.     sq_*)
  1527.     default_codeset=Lat15
  1528.     codeset_priority=low
  1529.     ;;
  1530.     sr_*)
  1531.     default_codeset=CyrSlav
  1532.     codeset_priority=low
  1533.     ;;
  1534.     st_*)
  1535.     default_codeset=Lat15 # TODO: Is this correct? (Sotho language)
  1536.     codeset_priority=low
  1537.     ;;
  1538.     sv_*)
  1539.     default_codeset=Lat15
  1540.     codeset_priority=low
  1541.     ;;
  1542.     ta_*)
  1543.     default_codeset=unsupported
  1544.     codeset_priority=low
  1545.     ;;
  1546.     te_*)
  1547.     default_codeset=unsupported
  1548.     codeset_priority=low
  1549.     ;;
  1550.     tg_*)
  1551.     default_codeset=CyrAsia
  1552.     codeset_priority=low
  1553.     ;;
  1554.     th_*)
  1555.     default_codeset=Thai
  1556.     codeset_priority=low
  1557.     ;;
  1558.     ti_*)
  1559.     default_codeset=Ethiopian
  1560.     codeset_priority=low
  1561.     ;;
  1562.     tig_*)
  1563.     default_codeset=Ethiopian
  1564.     codeset_priority=low
  1565.     ;;
  1566.     tl_*)
  1567.     default_codeset=Lat15
  1568.     codeset_priority=low
  1569.     ;;
  1570.     tr_*)
  1571.     default_codeset=Lat15
  1572.     codeset_priority=low
  1573.     ;;
  1574.     tt_*)
  1575.     default_codeset=Lat15 # TODO: Is this correct? (Tatar language)
  1576.     codeset_priority=low
  1577.     ;;
  1578.     uk_*)
  1579.     default_codeset=CyrSlav
  1580.     codeset_priority=low
  1581.     ;;
  1582.     ur_*)
  1583.     default_codeset=Arabic
  1584.     codeset_priority=low
  1585.     ;;
  1586.     uz_*)
  1587.     default_codeset=Lat15 # TODO: Is this correct? (Uzbek language)
  1588.     codeset_priority=low
  1589.     ;;
  1590.     uz_*\@cyrillic)
  1591.     default_codeset=CyrAsia
  1592.     codeset_priority=low
  1593.     ;;
  1594.     vi_*)
  1595.     default_codeset=Vietnamese
  1596.     codeset_priority=low
  1597.     ;;
  1598.     wa_*)
  1599.     default_codeset=Lat15
  1600.     codeset_priority=low
  1601.     ;;
  1602.     xh_*)
  1603.     default_codeset=Lat15
  1604.     codeset_priority=low
  1605.     ;;
  1606.     yi_*)
  1607.     default_codeset=Hebrew
  1608.     codeset_priority=low
  1609.     ;;
  1610.     zh_*)
  1611.     default_codeset=unsupported
  1612.     codeset_priority=low
  1613.     ;;
  1614.     zu_*)
  1615.     default_codeset=Lat15
  1616.     codeset_priority=low
  1617.     ;;
  1618.     *)
  1619.     default_codeset=Uni1
  1620.     codeset_priority=high
  1621.     ;;
  1622. esac
  1623. if [ "$default_codeset" = unsupported ]; then
  1624.     default_codeset=Uni1
  1625. fi
  1626.  
  1627. default_codeset="`decode_codeset $default_codeset`"
  1628. if [ -z "$default_codeset" ]; then
  1629.     default_codeset=Uni1
  1630.     codeset_priority=high
  1631. fi
  1632.  
  1633. default_layout=''
  1634. default_variant=''
  1635. if [ -e /etc/console/boottime.kmap.gz ]; then
  1636.     # Upgrade from pre-console-setup; we need to ask if autodetection fails.
  1637.     layout_priority=critical
  1638. else
  1639.     # Probably a fresh installation. If the installation is being automated,
  1640.     # then in the worst case selecting a "us" layout won't break the system,
  1641.     # so drop the priority a little bit.
  1642.     layout_priority=high
  1643. fi
  1644. case "$locale" in
  1645.     # Keyboards for countries
  1646.     *_AL*)
  1647.     default_layout=al  # Albania
  1648.     ;;
  1649.     *_AZ*)
  1650.     default_layout=az  # Azerbaijan
  1651.     ;;
  1652.     *_BD*)
  1653.     default_layout=bd  # Bangladesh
  1654.     ;;
  1655.     *_BE*)
  1656.     default_layout=be  # Belgium
  1657.     ;;
  1658.     *_BG*)
  1659.     default_layout=bg  # Bulgaria
  1660.     layout_priority=critical
  1661.     ;;
  1662.     *_BR*)
  1663.     default_layout=br  # Brazil
  1664.     ;;
  1665.     *_BY*)
  1666.     default_layout=by  # Belarus
  1667.     ;;
  1668.     fr_CA*)
  1669.     default_layout=ca  # Canada
  1670.     ;;
  1671.     *_CA*)
  1672.     default_layout=us  # U.S. English
  1673.     ;;
  1674.     fr_CH*)
  1675.     default_layout=ch  # Switzerland
  1676.     default_variant=fr # French
  1677.     ;;
  1678.     *_CH*)
  1679.     default_layout=ch  # Switzerland
  1680.     layout_priority=critical
  1681.     ;;
  1682.     *_CZ*)
  1683.     default_layout=cz  # Czechia
  1684.     layout_priority=critical
  1685.     ;;
  1686.     *_DK*)
  1687.     default_layout=dk  # Denmark
  1688.     ;;
  1689.     *_EE*)
  1690.     default_layout=ee  # Estonia
  1691.     ;;
  1692.     *_ES*)
  1693.     default_layout=es  # Spain
  1694.     ;;
  1695.     se_FI*)
  1696.     default_layout=fi  # Finland
  1697.     default_variant=smi # Northern Saami
  1698.     ;;
  1699.     *_FI*)
  1700.     default_layout=fi  # Finland
  1701.     default_variant=fi # Finland
  1702.     ;;
  1703.     *_GB*)
  1704.     default_layout=gb  # United Kingdom
  1705.     ;;
  1706.     *_HU*)
  1707.     default_layout=hu  # Hungary
  1708.     ;;
  1709.     *_IE*)
  1710.     default_layout=ie  # Ireland
  1711.     ;;
  1712.     *_IL*)
  1713.     default_layout=il  # Israel
  1714.     layout_priority=critical
  1715.     ;;
  1716.     *_IR*)
  1717.     default_layout=ir  # Iran
  1718.     ;;
  1719.     *_IS*)
  1720.     default_layout=is  # Iceland
  1721.     ;;
  1722.     *_IT*)
  1723.     default_layout=it  # Italy
  1724.     ;;
  1725.     *_JP*)
  1726.     default_layout=jp  # Japan
  1727.     ;;
  1728.     *_LT*)
  1729.     default_layout=lt  # Lithuania
  1730.     layout_priority=critical
  1731.     ;;
  1732.     *_LV*)
  1733.     default_layout=lv  # Latvia
  1734.     ;;
  1735.     *_MA*)
  1736.     default_layout=ma  # Morocco
  1737.     ;;
  1738.     *_MK*)
  1739.     default_layout=mk  # Macedonia
  1740.     ;;
  1741. # According to https://launchpad.net/bugs/129982, Dutch users prefer the US
  1742. # keymap.
  1743.     *_NL*)
  1744.     default_layout=us  # Netherlands
  1745.     default_variant=intl # International (with dead keys)
  1746.     ;;
  1747.     *_MN*)
  1748.     default_layout=mn  # Mongolia
  1749.     ;;
  1750.     *_MT*)
  1751.     default_layout=mt  # Malta
  1752.     layout_priority=critical
  1753.     ;;
  1754.     se_NO*)
  1755.     default_layout=no  # Norway
  1756.     default_variant=smi # Northern Saami
  1757.     ;;
  1758.     *_NO*)
  1759.     default_layout=no  # Norway (se_NO is not in this case)
  1760.     ;;
  1761.     *_PL*)
  1762.     default_layout=pl  # Poland
  1763.     ;;
  1764.     *_PT*)
  1765.     default_layout=pt  # Portugal
  1766.     ;;
  1767.     *_RO*)
  1768.     default_layout=ro  # Romania
  1769.     ;;
  1770.     *_RU*)
  1771.     default_layout=ru  # Russia
  1772.     layout_priority=critical
  1773.     ;;
  1774.     se_SE*)
  1775.     default_layout=se  # Sweden
  1776.     default_variant=smi # Northern Saami
  1777.     ;;
  1778.     *_SK*)
  1779.     default_layout=sk  # Slovakia
  1780.     ;;
  1781.     *_SI*)
  1782.     default_layout=si  # Slovenia
  1783.     ;;
  1784.     *_TJ*)
  1785.     default_layout=tj  # Tajikistan
  1786.     ;;
  1787.     *_TH*)
  1788.     default_layout=th  # Thailand
  1789.     layout_priority=critical
  1790.     ;;
  1791.     ku_TR*)
  1792.     default_layout=tr  # Turkish
  1793.     default_variant=ku # Kurdish, Latin Q
  1794.     ;;
  1795.     *_TR*)
  1796.     default_layout=tr  # Turkish
  1797.     layout_priority=critical
  1798.     ;;
  1799.     *_UA*)
  1800.     default_layout=ua  # Ukraine
  1801.     ;;
  1802.     en_US*)
  1803.     default_layout=us  # U.S. English
  1804.     ;;
  1805. # According to https://launchpad.net/bugs/191451, most keyboards in Vietnam
  1806. # are in fact US keyboards.
  1807.     *_VN*)
  1808.     default_layout=us  # Vietnam
  1809.     ;;
  1810.     # Keyboards for specific languages and international keyboards:
  1811.     # TODO: Is the following list correct?
  1812.     *_AR*|*_BO*|*_CL*|*_CO*|*_CR*|*_DO*|*_EC*|*_GT*|*_HN*|*_MX*|*_NI*|*_PA*|*_PE*|es_PR*|*_PY*|*_SV*|es_US*|*_UY*|*_VE*)
  1813.     default_layout=latam # Latin American
  1814.     ;;
  1815.     ar_*)
  1816.     default_layout=ara # Arabic
  1817.     ;;
  1818.     bs_*)
  1819.     default_layout=ba  # Bosnia and Herzegovina
  1820.     ;;
  1821.     de_*)
  1822.     default_layout=de  # Germany
  1823.     ;;
  1824.     el_*)
  1825.     default_layout=gr  # Greece
  1826.     ;;
  1827.     eo|eo.*|eo_*|eo\@*)
  1828.     default_layout=epo  # Esperanto
  1829.     ;;
  1830.     fr_*)
  1831.     default_layout=fr  # France
  1832.     default_variant=oss # Alternative
  1833.     layout_priority=critical
  1834.     ;;
  1835.     gu_*)
  1836.     default_layout=in  # India
  1837.     default_variant=guj # Gujarati
  1838.     ;;
  1839.     hi_*)
  1840.     default_layout=in  # India
  1841.     default_variant=deva # Devanagari
  1842.     ;;
  1843.     hr_*)
  1844.     default_layout=hr  # Croatia
  1845.     ;;
  1846.     hy_*)
  1847.     default_layout=am  # Armenia
  1848.     ;;
  1849.     ka_*)
  1850.     default_layout=ge  # Georgia
  1851.     layout_priority=critical
  1852.     ;;
  1853.     kn_*)
  1854.     default_layout=in  # India
  1855.     default_variant=kan # Kannada
  1856.     ;;
  1857.     lo_*)
  1858.     default_layout=la  # Laos
  1859.     ;;
  1860.     ml_*)
  1861.     default_layout=in  # India
  1862.     default_variant=mal # Malayalam
  1863.     ;;
  1864.     pa_*)
  1865.     default_layout=in  # India
  1866.     default_variant=guru # Gurmukhi
  1867.     ;;
  1868.     sr_ME*)
  1869.     default_layout=me  # Montenegro
  1870.     layout_priority=critical
  1871.     ;;
  1872.     sr_*)
  1873.     default_layout=rs  # Serbia
  1874.     layout_priority=critical
  1875.     ;;
  1876.     sv_*)
  1877.     default_layout=se  # Sweden
  1878.     default_variant=basic
  1879.     ;;
  1880.     ta_*)
  1881.     default_layout=in  # India
  1882.     default_variant=tam # Tamil
  1883.     ;;
  1884.     te_*)
  1885.     default_layout=in  # India
  1886.     default_variant=tel # Telugu
  1887.     ;;
  1888.     zh_CN)
  1889.     default_layout=cn  # China
  1890.     ;;
  1891.     # Fallback
  1892.     *)
  1893.     default_layout=us
  1894.     ;;
  1895. esac
  1896.  
  1897. if \
  1898.     [ -d /lib/debian-installer ] \
  1899.     && db_get debian-installer/charmap \
  1900.     && [ "$RET" ]
  1901. then
  1902.     default_charmap="$RET"
  1903. elif [ "$locale" = C ]; then
  1904.     default_charmap=UTF-8
  1905.     charmap_priority=high
  1906. elif which locale >/dev/null; then
  1907.     default_charmap=`locale charmap`
  1908. else
  1909.     default_charmap=unknown
  1910. fi
  1911. if echo "$charmaps" | grep "$default_charmap" >/dev/null; then
  1912.     charmap_priority=low
  1913. else
  1914.     default_charmap=UTF-8
  1915.     charmap_priority=high
  1916. fi
  1917.  
  1918. arch=`guess_arch`
  1919.  
  1920. case "$arch" in
  1921.     alpha*)
  1922.     default_model=pc105
  1923.     model_priority=medium
  1924.     ;;
  1925.     amd64*)
  1926.     default_model=pc105
  1927.     model_priority=medium
  1928.     ;;
  1929.     arm*)
  1930.     default_model=pc105
  1931.     model_priority=medium
  1932.     ;;
  1933.     i386*)
  1934.     default_model=pc105
  1935.     model_priority=medium
  1936.     ;;
  1937.     ia64*)
  1938.     default_model=pc105
  1939.     model_priority=medium
  1940.     ;;
  1941.     m68k/amiga)
  1942.     default_model=amiga
  1943.     model_priority=medium
  1944.     ;;
  1945.     m68k/atari)
  1946.     default_model=ataritt
  1947.     model_priority=medium
  1948.     ;;
  1949.     m68k/mac)
  1950.     default_model=macintosh_old
  1951.     model_priority=medium
  1952.     ;;
  1953.     m68k/sun*)
  1954.     default_model=sun4 # also sun5, pc105
  1955.     model_priority=critical
  1956.     ;;
  1957.     m68k/*vme*)
  1958.     default_model=pc105
  1959.     model_priority=medium
  1960.     ;;
  1961.     mips*)
  1962.     default_model=pc105
  1963.     model_priority=medium
  1964.     ;;
  1965.     powerpc/amiga)
  1966.     default_model=amiga
  1967.     model_priority=medium
  1968.     ;;
  1969.     powerpc/apus)
  1970.     default_model=amiga
  1971.     model_priority=medium
  1972.     ;;
  1973.     powerpc/chrp*)
  1974.     default_model=pc105 # also macintosh_old and maybe amiga
  1975.     model_priority=critical
  1976.     ;;
  1977.     powerpc/mac)
  1978.     default_model=pc105
  1979.     model_priority=medium
  1980.     ;;
  1981.     powerpc/pasemi)
  1982.     default_model=pc105
  1983.     model_priority=medium
  1984.     ;;
  1985.     powerpc/powermac*)
  1986.     default_model=pc105
  1987.     model_priority=medium
  1988.     ;;
  1989.     powerpc/prep)
  1990.     default_model=pc105
  1991.     model_priority=medium
  1992.     ;;
  1993.     powerpc/ps3|powerpc/cell)
  1994.     default_model=pc105
  1995.     model_priority=medium
  1996.     ;;
  1997.     sparc*)
  1998.     default_model=pc105 # also sun4, sun5
  1999.     model_priority=critical
  2000.     ;;
  2001.     s390*)
  2002.     default_model=pc105
  2003.     model_priority=medium
  2004.     ;;
  2005.     *)
  2006.     default_model=pc105
  2007.     model_priority=critical
  2008.     ;;
  2009. esac    
  2010.  
  2011. #######################################################################
  2012.  
  2013. # Use the value of debian-installer/keymap to get better default
  2014. # layout.  Lower the priority of the Debconf question to medium.
  2015.  
  2016. # This is a desperation measure, but required for migration from
  2017. # pre-console-setup systems without X installed. We just have to copy
  2018. # the guesswork formerly done by xserver-xorg.config.
  2019.  
  2020. if db_get debian-installer/keymap && [ "$RET" ]; then
  2021.     di_keymap="${RET##mac-usb-}"
  2022.     di_keymap="${di_keymap%%-latin1}"
  2023.  
  2024.     XKBMODEL=''
  2025.     XKBLAYOUT=''
  2026.     XKBVARIANT=''
  2027.     case "$di_keymap" in
  2028.     be2) XKBLAYOUT="be";;
  2029.     bg) XKBLAYOUT="bg"; XKBVARIANT="bds";;
  2030.     br) XKBLAYOUT="us"; XKBVARIANT="intl"; XKBMODEL="pc104";;
  2031.     br-abnt2) XKBLAYOUT="br"; XKBVARIANT="abnt2"; XKBMODEL="abnt2";;
  2032.     by) XKBLAYOUT="by";;
  2033.     cf) XKBLAYOUT="ca"; XKBVARIANT="fr";;
  2034.     croat) XKBLAYOUT="hr";;
  2035.     cz-lat2) XKBLAYOUT="cz";;
  2036.     de-latin1-nodeadkeys) XKBLAYOUT="de"; XKBVARIANT="nodeadkeys";;
  2037.     de) XKBLAYOUT="de";;
  2038.     dvorak) XKBLAYOUT="us"; XKBVARIANT="dvorak"; XKBMODEL="pc104";;
  2039.     dk) XKBLAYOUT="dk";;
  2040.     es) XKBLAYOUT="es";;
  2041.     et) XKBLAYOUT="ee";;
  2042.     'fi') XKBLAYOUT="fi";;
  2043.     fr-latin9) XKBLAYOUT="fr"; XKBVARIANT="latin9";;
  2044.     fr_CH) XKBLAYOUT="ch"; XKBVARIANT="fr";;
  2045.     fr) XKBLAYOUT="fr";;
  2046.     hebrew) XKBLAYOUT="il";;
  2047.     hu) XKBLAYOUT="hu";;
  2048.     gb) XKBLAYOUT="gb";;
  2049.     is) XKBLAYOUT="is";;
  2050.     it) XKBLAYOUT="it";;
  2051.     jp106) XKBLAYOUT="jp"; XKBVARIANT="kana"; XKBMODEL="jp106";;
  2052.     la) XKBLAYOUT="latam";;
  2053.     lt) XKBLAYOUT="lt";; 
  2054.     lv-latin4) XKBLAYOUT="lv";;
  2055.     mac-us-std) XKBLAYOUT="us";;
  2056.     mac-de2-ext) XKBLAYOUT="de"; XKBVARIANT="nodeadkeys";;
  2057.     mac-fr2-ext) XKBLAYOUT="fr";;
  2058.     mac-fr3) XKBLAYOUT="fr";;
  2059.     mac-es) XKBLAYOUT="es";;
  2060.     mk) XKBLAYOUT="mk";;
  2061.     nl) XKBLAYOUT="nl";;
  2062.     no) XKBLAYOUT="no";;
  2063.     pl) XKBLAYOUT="pl";;
  2064.     pt) XKBLAYOUT="pt";;
  2065.     ro) XKBLAYOUT="ro";;
  2066.     ru) XKBLAYOUT="ru";;
  2067.     se) XKBLAYOUT="se";;
  2068.     sg) XKBLAYOUT="ch"; XKBVARIANT="de";;
  2069.     sk-qwerty) XKBLAYOUT="sk"; XKBVARIANT="qwerty";;
  2070.     slovene) XKBLAYOUT="si";;
  2071.     sr-cy) XKBLAYOUT="rs";;
  2072.     trf|trfu) XKBLAYOUT="tr"; XKBVARIANT="f";;
  2073.     trq|trqu) XKBLAYOUT="tr";;
  2074.     ua) XKBLAYOUT="ua";;
  2075.     uk) XKBLAYOUT="gb";;
  2076.     us) XKBLAYOUT="us"; XKBMODEL="pc104";;
  2077.     esac
  2078.  
  2079.     # Currently the following two lines are meaningless but stay here
  2080.     # in case some wants to use the real XkbLayout and XkbVariant for
  2081.     # the non-Latin layouts
  2082.     XKBLAYOUT=${XKBLAYOUT#*,}
  2083.     XKBVARIANT=${XKBVARIANT#*,}
  2084.  
  2085.     case "$XKBLAYOUT" in
  2086.     '')
  2087.         layout_priority=critical
  2088.         ;;
  2089.     bg)
  2090.         # since there are two incompatible layouts and the console
  2091.         # provides only one of them
  2092.         default_layout="$XKBLAYOUT"
  2093.         default_variant="$XKBVARIANT"
  2094.         layout_priority=high
  2095.         ;;
  2096.     *)
  2097.         if [ "$XKBMODEL" ]; then
  2098.         default_model="$XKBMODEL"
  2099.         fi
  2100.         default_layout="$XKBLAYOUT"
  2101.         default_variant="$XKBVARIANT"
  2102.         layout_priority=medium
  2103.         ;;
  2104.     esac
  2105. fi
  2106.     
  2107. # Get defaults from debconf, to allow preseeding.
  2108. if [ -d /lib/debian-installer ] || [ "$OVERRIDE_ALLOW_PRESEEDING" ]; then
  2109.     if db_get console-setup/modelcode && [ "$RET" ]; then
  2110.     default_model="$RET"
  2111.     fi
  2112.     if db_get console-setup/layoutcode && [ "$RET" ]; then
  2113.     default_layout="$RET"
  2114.     if db_fget console-setup/layoutcode seen && [ "$RET" = true ]; then
  2115.         layout_priority=medium
  2116.         db_set console-setup/ask_detect false
  2117.         db_fset console-setup/ask_detect seen true
  2118.     fi
  2119.     fi
  2120.     if db_get console-setup/variantcode && [ "$RET" ]; then
  2121.     default_variant="$RET"
  2122.     fi
  2123.     if db_get console-setup/optionscode && [ "$RET" ]; then
  2124.     XKBOPTIONS="$RET"
  2125.     got_xkboptions=yes
  2126.     fi
  2127.     if db_get console-setup/fontsize && [ "$RET" ]; then
  2128.     db_set console-setup/fontsize-text "$RET"
  2129.     db_set console-setup/fontsize-fb "$RET"
  2130.     fi
  2131. fi
  2132.  
  2133. # Load the config file, if it exists.
  2134. if [ -e $CONFIGFILE ]; then
  2135.     . $CONFIGFILE || true
  2136.     
  2137.     got_full_config=yes
  2138.     got_xkboptions=yes
  2139.     model_priority=medium
  2140.     layout_priority=medium
  2141.     default_ttys="$ACTIVE_CONSOLES"
  2142.     default_charmap="$CHARMAP"
  2143.     default_fontface="$FONTFACE"
  2144.     default_fontsize="$FONTSIZE"
  2145.     default_model="$XKBMODEL"
  2146.  
  2147.     default_codeset="`decode_codeset $CODESET`"
  2148.     if [ -z "$default_codeset" ]; then
  2149.     default_codeset=Uni1
  2150.     codeset_priority=high
  2151.     fi
  2152.  
  2153.     migrate_layout () {
  2154.     case "$1" in
  2155.         cs)
  2156.         echo rs
  2157.         ;;
  2158.         *)
  2159.         echo "$1"
  2160.         ;;
  2161.     esac
  2162.     }
  2163.  
  2164.     migrate_variant () {
  2165.     case "$1" in
  2166.         jp)
  2167.         case "$2" in
  2168.             latin)
  2169.             echo 106
  2170.             ;;
  2171.             jp106)
  2172.             echo kana
  2173.             ;;
  2174.             *)
  2175.             echo "$2"
  2176.             ;;
  2177.         esac
  2178.         ;;
  2179.         *)
  2180.         echo "$2"
  2181.         ;;
  2182.     esac
  2183.     }
  2184.  
  2185.     # Migration
  2186.     case "$XKBLAYOUT" in
  2187.     *,*)
  2188.         layout1="${XKBLAYOUT%%,*}"
  2189.         layout2="${XKBLAYOUT#*,}"
  2190.         variant1="${XKBVARIANT%%,*}"
  2191.         variant2="${XKBVARIANT#*,}"
  2192.         XKBLAYOUT="$(migrate_layout "$layout1"),$(migrate_layout "$layout2")"
  2193.         XKBVARIANT="$(migrate_variant "$layout1" "$variant1"),$(migrate_variant "$layout2" "$variant2")"
  2194.         ;;
  2195.     *)
  2196.         XKBLAYOUT="$(migrate_layout "$XKBLAYOUT")"
  2197.         XKBVARIANT="$(migrate_variant "$XKBLAYOUT" "$XKBVARIANT")"
  2198.         ;;
  2199.     esac
  2200.  
  2201.     case "$XKBLAYOUT" in
  2202.     lt,lt)
  2203.         default_layout=${XKBLAYOUT%,*}
  2204.         default_variant="${XKBVARIANT%,*}"
  2205.         unsupported_layout=no
  2206.         ;;        
  2207.     # TODO: make s.t. to not forget to update this list
  2208.     me,me|rs,rs|us,am|us,ara|us,ben|us,bd|us,bg|us,bt|us,by|us,deva|us,ge|us,gh|us,gr|us,guj|us,guru|us,il|us,in|us,ir|us,iku|jp,jp|us,jp|us,kan|us,kh|us,la|us,lao|us,lk|us,lt|us,mk|us,mm|us,mn|us,mv|us,mal|us,ori|us,pk|us,ru|us,scc|us,sy|us,syr|us,tel|us,th|us,tj|us,tam|us,ua|us,uz)
  2209.         default_layout=${XKBLAYOUT#*,}
  2210.         default_variant="${XKBVARIANT#*,}"
  2211.         unsupported_layout=no
  2212.         ;;        
  2213.     *,*)
  2214.         unsupported_layout=yes
  2215.         ;;
  2216.     *)
  2217.         default_layout="$XKBLAYOUT"
  2218.         default_variant="$XKBVARIANT"
  2219.         ;;
  2220.     esac
  2221. fi
  2222.  
  2223. if [ "$got_xkboptions" = yes ]; then
  2224.     default_toggle='No toggling'
  2225.     default_switch='No temporary switch'
  2226.     default_altgr='No AltGr key'
  2227.     default_compose='No compose key'
  2228.     for option in `echo $XKBOPTIONS | sed 's/,/ /g'`; do
  2229.     case "$option" in
  2230.         compose:caps)
  2231.         default_compose='Caps Lock';;
  2232.         compose:lwin)
  2233.         default_compose='Left Logo key';;
  2234.         compose:menu)
  2235.         default_compose='Menu key';;
  2236.         compose:ralt)
  2237.         default_compose='Right Alt';;
  2238.         compose:rctrl)
  2239.         default_compose='Right Control';;
  2240.         compose:rwin)
  2241.         default_compose='Right Logo key';;
  2242.         grp:alt_caps_toggle)
  2243.         default_toggle='Alt+Caps Lock';;
  2244.         grp:alt_shift_toggle)
  2245.         default_toggle='Alt+Shift';;
  2246.         grp:caps_toggle)
  2247.         default_toggle='Caps Lock';;
  2248.         grp:ctrl_alt_toggle)
  2249.         default_toggle='Control+Alt';;
  2250.         grp:ctrl_shift_toggle)
  2251.         default_toggle='Control+Shift';;
  2252.         grp:lalt_toggle)
  2253.         default_toggle='Left Alt';;
  2254.         grp:lctrl_lshift_toggle)
  2255.         default_toggle='Left Control+Left Shift';;
  2256.         grp:lctrl_toggle)
  2257.         default_toggle='Left Control';;
  2258.         grp:lshift_toggle)
  2259.         default_toggle='Left Shift';;
  2260.         grp:lswitch)
  2261.         default_switch='Left Alt';;
  2262.         grp:lwin_switch)
  2263.         default_switch='Left Logo key';;
  2264.         grp:lwin_toggle)
  2265.         default_toggle='Left Logo key';;
  2266.         grp:menu_toggle)
  2267.         default_toggle='Menu key';;
  2268.         grp:rctrl_toggle)
  2269.         default_toggle='Right Control';;
  2270.         grp:rshift_toggle)
  2271.         default_toggle='Right Shift';;
  2272.         grp:rwin_switch)
  2273.         default_switch='Right Logo key';;
  2274.         grp:rwin_toggle)
  2275.         default_toggle='Right Logo key';;
  2276.         grp:sclk_toggle)
  2277.         default_toggle='Scroll Lock key';;
  2278.         grp:switch)
  2279.         default_switch='Right Alt';;
  2280.         grp:toggle)
  2281.         default_toggle='Right Alt';;
  2282.         grp:win_switch)
  2283.         default_switch='Both Logo keys';;
  2284.         lv3:alt_switch)
  2285.         default_altgr='Both Alt keys';;
  2286.         lv3:enter_switch)
  2287.         default_altgr='Keypad Enter key';;
  2288.         lv3:lalt_switch)
  2289.         default_altgr='Left Alt';;
  2290.         lv3:lwin_switch)
  2291.         default_altgr='Left Logo key';;
  2292.         lv3:menu_switch)
  2293.         default_altgr='Menu key';;
  2294.         lv3:ralt_switch)
  2295.         default_altgr='Right Alt';;
  2296.         lv3:rwin_switch)
  2297.         default_altgr='Right Logo key';;
  2298.         lv3:switch)
  2299.         default_altgr='Right Control';;
  2300.         lv3:win_switch)
  2301.         default_altgr='Both Logo keys';;
  2302.         grp_led:scroll)
  2303.         ;;
  2304.         *)
  2305.         unsupported_layout=yes;;
  2306.     esac
  2307.     done
  2308. fi
  2309.  
  2310. if [ "$got_full_config" = yes ]; then
  2311.     # Store values from config file into debconf db.
  2312.     
  2313.     db_set console-setup/ttys "$default_ttys"
  2314.     db_set console-setup/charmap "$default_charmap"
  2315.     db_set console-setup/codeset "$default_codeset"
  2316.     db_set console-setup/fontface "$default_fontface"
  2317.     db_set console-setup/fontsize-text "$default_fontsize"
  2318.     db_set console-setup/fontsize-fb "$default_fontsize"
  2319.     db_set console-setup/fontsize "$default_fontsize"
  2320. fi
  2321. if [ "$got_xkboptions" = yes ]; then
  2322.     db_set console-setup/toggle "$default_toggle"
  2323.     db_set console-setup/switch "$default_switch"
  2324.     db_set console-setup/altgr "$default_altgr"
  2325.     db_set console-setup/compose "$default_compose"
  2326. fi
  2327.  
  2328. #######################################################################
  2329.  
  2330. STATE=1
  2331. old_state=0
  2332. while :; do
  2333.     starting_state=$STATE
  2334.     case "$STATE" in
  2335.     1)
  2336.         if \
  2337.         ask_debconf console-setup/model $model_priority \
  2338.             model $default_model
  2339.         then
  2340.         db_set console-setup/modelcode "$RET"
  2341.         STATE=$(($STATE + 1))
  2342.         else
  2343.         STATE=$(($STATE - 1))
  2344.         fi
  2345.         ;;
  2346.     2)
  2347.         db_get console-setup/modelcode
  2348.         if \
  2349.         $detect_keyboard \
  2350.         && [ "$RET" != SKIP ] \
  2351.         && [ -e "/usr/share/console-setup-mini/$RET.tree" ]
  2352.         then
  2353.         db_input high console-setup/ask_detect || true
  2354.         if db_go; then
  2355.             STATE=$(($STATE + 1))
  2356.         else
  2357.             STATE=$(($STATE - 1))
  2358.         fi
  2359.         else
  2360.         STATE=$(($STATE + $STATE - $old_state))
  2361.         fi
  2362.         ;;
  2363.     3)
  2364.         db_get console-setup/modelcode
  2365.         model="$RET"
  2366.         if \
  2367.         [ "$STATE" -ge "$old_state" ] \
  2368.         && $detect_keyboard \
  2369.         && [ "$model" != SKIP ] \
  2370.         && [ -e "/usr/share/console-setup-mini/$model.tree" ] \
  2371.         && db_get console-setup/ask_detect \
  2372.         && [ "$RET" = true ]
  2373.         then
  2374.         db_subst console-setup/detect FILENAME \
  2375.             "/usr/share/console-setup-mini/$model.tree"
  2376.         if db_input critical console-setup/detect && db_go; then
  2377.             db_get console-setup/detect
  2378.             detected_keyboard="$RET"
  2379.             # TODO: produce human-readable layout name
  2380.             db_subst console-setup/detected LAYOUT "$detected_keyboard"
  2381.             db_input high console-setup/detected || true
  2382.             if db_go; then
  2383.             unsupported_layout=no
  2384.             STATE=$(($STATE + 1))
  2385.             else
  2386.             detected_keyboard=
  2387.             STATE=$(($STATE - 1))
  2388.             fi
  2389.         else
  2390.             STATE=$(($STATE - 1))
  2391.         fi
  2392.         else
  2393.         detected_keyboard=
  2394.         STATE=$(($STATE + $STATE - $old_state))
  2395.         fi
  2396.         ;;
  2397.     4)
  2398.         if [ "$detected_keyboard" ]; then
  2399.         layout="${detected_keyboard%%:*}"
  2400.         db_set console-setup/layoutcode "$layout"
  2401.         # skip the question without making Debconf loop
  2402.         STATE=$(( $STATE + $STATE - $old_state ))
  2403.         elif [ "$model" = SKIP ]; then
  2404.         STATE=$(( $STATE + $STATE - $old_state ))
  2405.         elif [ "$unsupported_layout" = yes ]; then
  2406.         if [ "$STATE" -ge "$old_state" ]; then
  2407.             db_input medium console-setup/dont_ask_layout || true
  2408.             db_go || true
  2409.             db_set console-setup/layoutcode "$XKBLAYOUT"
  2410.             STATE=$(($STATE + 1))
  2411.         else
  2412.             STATE=$(($STATE - 1))
  2413.         fi
  2414.         elif \
  2415.         ask_debconf console-setup/layout "$layout_priority" \
  2416.             layout "$default_layout"
  2417.         then
  2418.         layout="$RET"
  2419.         STATE=$(($STATE + 1))
  2420.         else
  2421.         STATE=$(($STATE - 1))
  2422.         fi
  2423.         ;;
  2424.     5)
  2425.         adjust_layout=false
  2426.         if [ "$detected_keyboard" ]; then
  2427.         case $detected_keyboard in
  2428.             *:*)
  2429.             variant="${detected_keyboard#*:}"
  2430.             ;;
  2431.             *)
  2432.             variant=
  2433.             ;;
  2434.         esac
  2435.         db_set console-setup/variantcode "$variant"
  2436.         adjust_layout=:
  2437.         # skip the question without making Debconf loop
  2438.         STATE=$(( $STATE + $STATE - $old_state ))
  2439.         elif [ "$model" = SKIP ]; then
  2440.         STATE=$(( $STATE + $STATE - $old_state ))
  2441.         elif [ "$unsupported_layout" = yes ]; then
  2442.         db_set console-setup/variantcode "$XKBVARIANT"
  2443.         # skip the question without making Debconf loop
  2444.         STATE=$(( $STATE + $STATE - $old_state ))
  2445.         elif \
  2446.         ask_debconf console-setup/variant "$layout_priority" \
  2447.                     "variant\*${layout}" "$default_variant"
  2448.         then
  2449.         variant="$RET"
  2450.         adjust_layout=:
  2451.         STATE=$(($STATE + 1))
  2452.         else
  2453.         STATE=$(($STATE - 1))
  2454.         fi
  2455.         if $adjust_layout; then
  2456.         case "$layout" in
  2457.             jp)
  2458.             case "$variant" in
  2459.                 106|common|OADG109A|nicola_f_bs)
  2460.                 latin=yes
  2461.                 real_layout=$layout
  2462.                 ;;
  2463.                 *)
  2464.                 latin=no
  2465.                 real_layout=jp,jp
  2466.                 ;;
  2467.             esac
  2468.             ;;
  2469.             lt)
  2470.             latin=no
  2471.             real_layout=lt,lt
  2472.             ;;
  2473.             me)
  2474.             case "$variant" in
  2475.                 basic|latin*)
  2476.                 latin=yes
  2477.                 real_layout=$layout
  2478.                 ;;
  2479.                 *)
  2480.                 latin=no
  2481.                 real_layout=me,me
  2482.                 ;;
  2483.             esac
  2484.             ;;
  2485.             rs)
  2486.             case "$variant" in
  2487.                 basic|latin*)
  2488.                 latin=yes
  2489.                 real_layout=$layout
  2490.                 ;;
  2491.                 *)
  2492.                 latin=no
  2493.                 real_layout=rs,rs
  2494.                 ;;
  2495.             esac
  2496.             ;;
  2497.             # TODO: make s.t. to not forget to update this list.  Don't
  2498.             # forget to update also the nonlatin list in kbdcompiler
  2499.             am|ara|ben|bd|bg|bt|by|deva|ge|gh|gr|guj|guru|il|in|ir|iku|kan|kh|la|lao|lk|mk|mm|mn|mv|mal|ori|pk|ru|scc|sy|syr|tel|th|tj|tam|ua|uz)
  2500.             latin=no
  2501.             real_layout=us,$layout
  2502.             ;;
  2503.             *)
  2504.             latin=yes
  2505.             real_layout=$layout
  2506.             ;;
  2507.         esac
  2508.         db_set console-setup/layoutcode "$real_layout"
  2509.         if [ "$latin" = yes ]; then
  2510.             db_set console-setup/variantcode "$variant"
  2511.         elif [ "$real_layout" = lt,lt ]; then
  2512.             case "$variant" in
  2513.             us)
  2514.                 db_set console-setup/variantcode "us,"
  2515.                 ;;
  2516.             *)
  2517.                 db_set console-setup/variantcode "$variant,us"
  2518.                 ;;
  2519.             esac
  2520.         elif [ "$real_layout" = jp,jp ]; then
  2521.                 db_set console-setup/variantcode "106,$variant"
  2522.         elif [ "$real_layout" = me,me ]; then
  2523.             case "$variant" in
  2524.             cyrillicyz)
  2525.                 db_set console-setup/variantcode \
  2526.                 "latinyz,$variant"
  2527.                 ;;
  2528.             cyrillicalternatequotes)
  2529.                 db_set console-setup/variantcode \
  2530.                 "latinalternatequotes,$variant"
  2531.                 ;;
  2532.             *)
  2533.                 db_set console-setup/variantcode \
  2534.                 "basic,$variant"
  2535.                 ;;
  2536.             esac
  2537.         elif [ "$real_layout" = rs,rs ]; then
  2538.             case "$variant" in
  2539.             yz)
  2540.                 db_set console-setup/variantcode \
  2541.                 "latinyz,$variant"
  2542.                 ;;
  2543.             alternatequotes)
  2544.                 db_set console-setup/variantcode \
  2545.                 "latinalternatequotes,$variant"
  2546.                 ;;
  2547.             *)
  2548.                 db_set console-setup/variantcode \
  2549.                 "latin,$variant"
  2550.                 ;;
  2551.             esac
  2552.         else
  2553.             db_set console-setup/variantcode ",$variant"
  2554.         fi
  2555.         fi
  2556.         ;;
  2557.     6)
  2558.         if [ "$unsupported_layout" = yes ]; then
  2559.         db_set console-setup/optionscode "$XKBOPTIONS"
  2560.         # skip the questions without making Debconf loop
  2561.         STATE=$(( $STATE + $STATE - $old_state ))
  2562.         elif [ "$model" = SKIP ]; then
  2563.         STATE=$(( $STATE + $STATE - $old_state ))
  2564.         else
  2565.         if [ "$latin" = yes ]; then
  2566.             db_default console-setup/toggle 'No toggling'
  2567.             db_default console-setup/switch 'No temporary switch'
  2568.         fi
  2569.         db_beginblock
  2570.         if [ "$latin" = no ]; then
  2571.             db_get console-setup/toggle
  2572.             if [ "$RET" = 'No toggling' ]; then
  2573.             db_reset console-setup/toggle
  2574.             fi
  2575.             db_input high console-setup/toggle || true
  2576.             db_input medium console-setup/switch || true
  2577.         fi
  2578.         if [ ! -f $CONFIGFILE -a "$layout" = us ]; then
  2579.             if [ "$variant" = '' ]; then
  2580.             # basic US keyboard doesn't use AltGr.
  2581.             db_default console-setup/altgr 'No AltGr key'
  2582.             else
  2583.             db_default console-setup/altgr 'Right Alt'
  2584.             fi
  2585.         fi
  2586.         db_input medium console-setup/altgr || true
  2587.         db_input medium console-setup/compose || true
  2588.         db_endblock
  2589.  
  2590.         if db_go; then 
  2591.             STATE=$(($STATE + 1))
  2592.         else
  2593.             STATE=$(($STATE - 1))
  2594.         fi
  2595.  
  2596.         db_get console-setup/toggle
  2597.         case "$RET" in
  2598.             Caps\ Lock)
  2599.                 caps_allocated=yes
  2600.                 toggle=caps_toggle;;
  2601.             Right\ Alt)
  2602.                 ralt_allocated=yes
  2603.                 toggle=toggle;;
  2604.             Right\ Control)
  2605.                 rctrl_allocated=yes
  2606.                 toggle=rctrl_toggle;;
  2607.             Right\ Shift)
  2608.                 rshift_allocated=yes
  2609.                 toggle=rshift_toggle;;
  2610.             Right\ Logo?key)
  2611.                 rwin_allocated=yes
  2612.                 toggle=rwin_toggle;;
  2613.             Menu?key)
  2614.             menu_allocated=yes
  2615.             toggle=menu_toggle;;
  2616.             Alt+Shift)
  2617.             toggle=alt_shift_toggle;;
  2618.             Control+Shift)
  2619.             toggle=ctrl_shift_toggle;;
  2620.             Left\ Control+Left\ Shift)
  2621.             toggle=lctrl_lshift_toggle;;
  2622.             Scroll\ Lock\ key)
  2623.             toggle=sclk_toggle;;
  2624.             Alt+Caps\ Lock)
  2625.             toggle=alt_caps_toggle;;
  2626.             Control+Alt)
  2627.             toggle=ctrl_alt_toggle;;
  2628.             Left\ Alt)
  2629.                 lalt_allocated=yes
  2630.                 toggle=lalt_toggle;;
  2631.             Left\ Control)
  2632.                 lctrl_allocated=yes
  2633.                 toggle=lctrl_toggle;;
  2634.             Left\ Shift)
  2635.                 lshift_allocated=yes
  2636.                 toggle=lshift_toggle;;
  2637.             Left\ Logo?key)
  2638.                 lwin_allocated=yes
  2639.                 toggle=lwin_toggle;;
  2640.             No\ toggling)
  2641.                 toggle='';;
  2642.             *)
  2643.             echo Unknown toggle key option
  2644.             exit 1
  2645.             ;;
  2646.         esac
  2647.         if [ "$toggle" ]; then
  2648.             toggle=grp:$toggle
  2649.         fi
  2650.         
  2651.         db_get console-setup/switch
  2652.         switch=''
  2653.         case "$RET" in
  2654.             Right\ Alt)
  2655.                 if [ "$ralt_allocated" != yes ]; then
  2656.                 switch=switch
  2657.                 ralt_allocated=yes
  2658.                 fi;;
  2659.             Left\ Alt)
  2660.                 if [ "$lalt_allocated" != yes ]; then
  2661.                 switch=lswitch
  2662.                 lalt_allocated=yes
  2663.                 fi;;
  2664.             Right\ Logo?key)
  2665.                 if [ "$rwin_allocated" != yes ]; then
  2666.                 switch=rwin_switch
  2667.                 rwin_allocated=yes
  2668.                 fi;;
  2669.             Left\ Logo?key)
  2670.                 if [ "$lwin_allocated" != yes ]; then
  2671.                 switch=lwin_switch
  2672.                 lwin_allocated=yes
  2673.                 fi;;
  2674.             Both\ Logo?keys)
  2675.                 if \
  2676.                 [ "$rwin_allocated" != yes ] \
  2677.                 && [ "$lwin_allocated" != yes ]
  2678.             then
  2679.                 switch=win_switch
  2680.                 rwin_allocated=yes
  2681.                 lwin_allocated=yes
  2682.                 fi;;
  2683.             No\ temporary\ switch)
  2684.                 switch='';;
  2685.             *)
  2686.             echo Unknown switch key option
  2687.             exit 1
  2688.             ;;
  2689.         esac
  2690.         if [ "$switch" ]; then
  2691.             switch=grp:$switch
  2692.         fi
  2693.         
  2694.         db_get console-setup/altgr
  2695.         altgr=''
  2696.         case "$RET" in
  2697.             No?AltGr?key)
  2698.             altgr='';;
  2699.             Right?Alt)
  2700.             if [ "$ralt_allocated" != yes ]; then
  2701.                 altgr=ralt_switch
  2702.                 ralt_allocated=yes
  2703.             fi;;
  2704.             Right?Control)
  2705.             if [ "$rctrl_allocated" != yes ]; then
  2706.                 altgr=switch
  2707.                 rctrl_allocated=yes
  2708.             fi;;
  2709.             Menu?key)
  2710.             if [ "$menu_allocated" != yes ]; then
  2711.                 altgr=menu_switch
  2712.                 menu_allocated=yes
  2713.             fi;;
  2714.             Keypad?Enter?key)
  2715.             altgr=enter_switch;;
  2716.             Right?Logo?key)
  2717.             if [ "$rwin_allocated" != yes ]; then
  2718.                 altgr=rwin_switch
  2719.                 rwin_allocated=yes
  2720.             fi;;
  2721.             Left?Logo?key)
  2722.             if [ "$lwin_allocated" != yes ]; then
  2723.                 altgr=lwin_switch
  2724.                 lwin_allocated=yes
  2725.             fi;;
  2726.             Both?Logo?keys)
  2727.             if \
  2728.                 [ "$rwin_allocated" != yes ] \
  2729.                 && [ "$lwin_allocated" != yes ]
  2730.             then
  2731.                 altgr=win_switch
  2732.                 rwin_allocated=yes
  2733.                 lwin_allocated=yes
  2734.             fi;;
  2735.             Both?Alt?keys)
  2736.             if \
  2737.                 [ "$lalt_allocated" != yes ] \
  2738.                 && [ "$ralt_allocated" != yes ]
  2739.             then
  2740.                 altgr=alt_switch
  2741.                 ralt_allocated=yes
  2742.                 lalt_allocated=yes
  2743.             fi;;
  2744.             Left?Alt)
  2745.             if [ "$lalt_allocated" != yes ]; then
  2746.                 altgr=lalt_switch
  2747.                 lalt_allocated=yes
  2748.             fi;;
  2749.             *)
  2750.             echo Unknown altgr key option
  2751.             exit 1
  2752.             ;;
  2753.         esac
  2754.         if [ "$altgr" ]; then
  2755.             altgr=lv3:$altgr
  2756.         fi
  2757.  
  2758.         db_get console-setup/compose
  2759.         compose=''
  2760.         case "$RET" in
  2761.             No?compose?key)
  2762.             compose='';;
  2763.             Right?Alt)
  2764.             if [ "$ralt_allocated" != yes ]; then
  2765.                 compose=ralt
  2766.                 ralt_allocated=yes
  2767.             fi;;
  2768.             Right?Logo?key)
  2769.             if [ "$rwin_allocated" != yes ]; then
  2770.                 compose=rwin
  2771.                 rwin_allocated=yes
  2772.             fi;;
  2773.             Left?Logo?key)
  2774.             if [ "$lwin_allocated" != yes ]; then
  2775.                 compose=lwin 
  2776.                 lwin_allocated=yes
  2777.             fi;;
  2778.             Right?Control)
  2779.             if [ "$rctrl_allocated" != yes ]; then
  2780.                 compose=rctrl 
  2781.                 rctrl_allocated=yes
  2782.             fi;;
  2783.             Menu?key)
  2784.             if [ "$menu_allocated" != yes ]; then
  2785.                 compose=menu
  2786.                 menu_allocated=yes
  2787.             fi;;
  2788.             Caps?Lock)
  2789.             if [ "$caps_allocated" != yes ]; then
  2790.                 compose=caps
  2791.                 caps_allocated=yes
  2792.             fi;;
  2793.             *)
  2794.             echo Unknown compose key option
  2795.             exit 1
  2796.             ;;
  2797.         esac
  2798.         if [ "$compose" ]; then
  2799.             compose=compose:$compose
  2800.         fi
  2801.         
  2802.         case "$real_layout" in
  2803.             *,*)
  2804.                 leds=grp_led:scroll;;
  2805.             *)
  2806.             leds='';;
  2807.         esac
  2808.         
  2809.         options=$(
  2810.             echo $toggle $switch $altgr $compose $leds \
  2811.             | sed -e 's/^ *//' -e 's/ *$//' -e 's/  */,/g'
  2812.         )
  2813.         db_set console-setup/optionscode "$options"
  2814.         fi
  2815.         ;;            
  2816.     7)
  2817.         if [ "$package" = console-setup-mini ]; then
  2818.         if [ "$STATE" -ge "$old_state" ]; then
  2819.             STATE=$(($STATE + 1))
  2820.         else
  2821.             STATE=$(($STATE - 1))
  2822.         fi
  2823.         charmap=UTF-8
  2824.         else
  2825.         # add commas
  2826.         choices=`echo "$charmaps" | sed -e 's/$/,/g' | LC_ALL=C sort `
  2827.         # remove newlines
  2828.         choices=`echo $choices | sed -e 's/,$//' `
  2829.         db_subst console-setup/charmap CHOICES "$choices"
  2830.         db_default console-setup/charmap "$default_charmap"
  2831.         db_input $charmap_priority console-setup/charmap || true
  2832.         if db_go; then
  2833.             STATE=$(($STATE + 1))
  2834.         else
  2835.             STATE=$(($STATE - 1))
  2836.         fi
  2837.         db_get console-setup/charmap
  2838.         charmap=$RET
  2839.         fi
  2840.         ;;
  2841.     8)
  2842.         # It shouldn't be possible for $default_codeset to be
  2843.         # empty, but just a precaution.
  2844.         if [ "$default_codeset" ]; then
  2845.         db_default console-setup/codeset "$default_codeset"
  2846.         fi
  2847.         db_input $codeset_priority console-setup/codeset || true
  2848.         if db_go; then
  2849.         db_get console-setup/codeset
  2850.         codeset="`encode_codeset $RET`"
  2851.         db_set console-setup/codesetcode "$codeset"
  2852.         STATE=$(($STATE + 1))
  2853.         else
  2854.         STATE=$(($STATE - 1))
  2855.         fi
  2856.         ;;
  2857.     9)
  2858.         fontfaces=`available_fontfaces`
  2859.         # add commas
  2860.         choices=`echo "$fontfaces" | sed -e 's/$/,/g'`
  2861.         # remove newlines
  2862.         choices=`echo $choices | sed -e 's/,$//'`
  2863.         db_subst console-setup/fontface CHOICES "$choices"
  2864.         if [ -z "$default_fontface" ]; then
  2865.         case "$codeset" in
  2866.             Arabic)
  2867.             default_fontface=Fixed
  2868.             ;;
  2869.             Armenian)
  2870.             default_fontface=Fixed
  2871.             ;;
  2872.             CyrAsia)
  2873.             default_fontface=Fixed
  2874.             ;;
  2875.             CyrKoi)
  2876.             default_fontface=VGA
  2877.             ;;
  2878.             CyrSlav)
  2879.             default_fontface=VGA
  2880.             ;;
  2881.             Ethiopian)
  2882.             default_fontface=Goha
  2883.             ;;
  2884.             Georgian)
  2885.             default_fontface=Fixed
  2886.             ;;
  2887.             Greek)
  2888.             default_fontface=Fixed
  2889.             ;;
  2890.             Hebrew)
  2891.             default_fontface=Fixed
  2892.             ;;
  2893.             Lao)
  2894.             default_fontface=Fixed
  2895.             ;;
  2896.             Lat15)
  2897.             default_fontface=VGA
  2898.             ;;
  2899.             Lat2)
  2900.             default_fontface=VGA
  2901.             ;;
  2902.             Lat38)
  2903.             default_fontface=Fixed
  2904.             ;;
  2905.             Lat7)
  2906.             default_fontface=VGA
  2907.             ;;
  2908.             Thai)
  2909.             default_fontface=Fixed
  2910.             ;;
  2911.             Uni1)
  2912.             default_fontface=Fixed
  2913.             ;;
  2914.             Uni2)
  2915.             default_fontface=Fixed
  2916.             ;;
  2917.             Uni3)
  2918.             default_fontface=Fixed
  2919.             ;;
  2920.             Vietnamese)
  2921.             default_fontface=Fixed
  2922.             ;;
  2923.             *)
  2924.             default_fontface=Fixed
  2925.             ;;
  2926.         esac
  2927.         fi
  2928.         db_default console-setup/fontface "$default_fontface"
  2929.         db_input medium console-setup/fontface || true
  2930.         if db_go; then
  2931.         STATE=$(($STATE + 1))
  2932.         else
  2933.         STATE=$(($STATE - 1))
  2934.         fi
  2935.         db_get console-setup/fontface
  2936.         fontface=$RET
  2937.         ;;
  2938.     10)
  2939.         fontsizes=`available_fontsizes`
  2940.         # add commas
  2941.         choices=`echo "$fontsizes" | sed -e 's/$/,/g' `
  2942.         # remove newlines
  2943.         choices=`echo $choices | sed -e 's/,$//'`
  2944.         if echo "$choices" | grep -q x; then
  2945.         size_template=console-setup/fontsize-fb
  2946.         else
  2947.         size_template=console-setup/fontsize-text
  2948.         fi
  2949.         db_subst $size_template CHOICES "$choices"
  2950.         db_input medium $size_template || true
  2951.         if db_go; then
  2952.         STATE=$(($STATE + 1))
  2953.         else
  2954.         STATE=$(($STATE - 1))
  2955.         fi
  2956.         db_get $size_template
  2957.         fontsize=$RET
  2958.         db_set console-setup/fontsize "$fontsize"
  2959.         ;;
  2960.     11)
  2961.         db_input medium console-setup/ttys || true
  2962.         if db_go; then
  2963.         STATE=$(($STATE + 1))
  2964.         else
  2965.         STATE=$(($STATE - 1))
  2966.         fi
  2967.         db_get console-setup/ttys
  2968.         ttys=$RET
  2969.         ;;
  2970.     *)
  2971.         break
  2972.         ;;
  2973.     esac
  2974.     old_state=$starting_state
  2975. done
  2976.  
  2977. if [ $STATE -eq 0 ]; then
  2978.     exit 10
  2979. else
  2980.     # we don't do the following corrections during the state 2 or 3 of
  2981.     # the loop because if the user backs up and selects another layout
  2982.     # the keyboard model will be wrong.  We also want the combinations
  2983.     # Brasilian layout on Japanese keyboard and Japanese layout on
  2984.     # Brasilian keyboard to be possible.
  2985.     db_get console-setup/modelcode
  2986.     if [ "$RET" = "$default_model" ]; then
  2987.     if [ "$layout" = br ]; then 
  2988.         model=abnt2
  2989.     elif [ "$layout" = jp ]; then 
  2990.         model=jp106
  2991.     fi
  2992.     db_set console-setup/modelcode "$model"
  2993.     fi
  2994. fi
  2995.